diff -aur e2fsprogs-1.42.8/aclocal.m4 e2fsprogs/aclocal.m4
--- e2fsprogs-1.42.8/aclocal.m4	2012-12-23 06:20:13.000000000 +0400
+++ e2fsprogs/aclocal.m4	2015-11-13 01:01:53.016768215 +0300
@@ -402,12 +402,11 @@
     [AC_DEFINE([ptrdiff_t], [long],
        [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
     ])
-  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
+  AC_CHECK_HEADERS([limits.h locale.h stddef.h \
+stdlib.h string.h unistd.h])
   AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
-mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
-strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
-__fsetlocking])
+munmap putenv setenv setlocale snprintf strcasecmp strdup \
+strtoul wcslen])
 
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
diff -aur e2fsprogs-1.42.8/configure e2fsprogs/configure
--- e2fsprogs-1.42.8/configure	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/configure	2015-11-13 01:01:53.708768210 +0300
@@ -8245,8 +8245,8 @@
 
 fi
 
-  for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h
+  for ac_header in limits.h locale.h stddef.h \
+stdlib.h string.h unistd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -8260,9 +8260,8 @@
 done
 
   for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \
-mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
-strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
-__fsetlocking
+munmap putenv setenv setlocale snprintf strcasecmp strdup \
+strtoul wcslen
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -10361,7 +10360,7 @@
 done
 
 fi
-for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	linux/falloc.h 	linux/fd.h 	linux/major.h 	net/if_dl.h 	netinet/in.h 	sys/disklabel.h 	sys/file.h 	sys/ioctl.h 	sys/mkdev.h 	sys/mman.h 	sys/prctl.h 	sys/queue.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h
+for ac_header in  	dirent.h 	errno.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	unistd.h 	utime.h 	netinet/in.h 	sys/ioctl.h 	sys/select.h 	sys/socket.h 	sys/stat.h 	sys/time.h 	sys/types.h 	sys/wait.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -10392,9 +10391,10 @@
 
 done
 
-for ac_header in net/if.h
+for ac_header
 do :
-  ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -10403,9 +10403,9 @@
 #endif
 
 "
-if test "x$ac_cv_header_net_if_h" = xyes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_NET_IF_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -11032,7 +11032,7 @@
 fi
 
 fi
-for ac_func in  	__secure_getenv 	backtrace 	blkid_probe_get_topology 	chflags 	fallocate 	fallocate64 	fchown 	fdatasync 	fstat64 	ftruncate64 	getdtablesize 	getmntinfo 	getpwuid_r 	getrlimit 	getrusage 	jrand48 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_memalign 	prctl 	secure_getenv 	setmntent 	setresgid 	setresuid 	srandom 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	valloc
+for ac_func in  	backtrace 	getpwuid_r 	memalign 	mmap 	nanosleep 	strdup 	usleep
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff -aur e2fsprogs-1.42.8/configure.in e2fsprogs/configure.in
--- e2fsprogs-1.42.8/configure.in	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/configure.in	2015-11-13 01:01:53.016768215 +0300
@@ -840,43 +840,21 @@
 AC_CHECK_HEADERS(m4_flatten([
 	dirent.h
 	errno.h
-	execinfo.h
-	getopt.h
-	malloc.h
-	mntent.h
-	paths.h
-	semaphore.h
 	setjmp.h
 	signal.h
 	stdarg.h
 	stdint.h
 	stdlib.h
 	termios.h
-	termio.h
 	unistd.h
 	utime.h
-	linux/falloc.h
-	linux/fd.h
-	linux/major.h
-	net/if_dl.h
 	netinet/in.h
-	sys/disklabel.h
-	sys/file.h
 	sys/ioctl.h
-	sys/mkdev.h
-	sys/mman.h
-	sys/prctl.h
-	sys/queue.h
-	sys/resource.h
 	sys/select.h
 	sys/socket.h
-	sys/sockio.h
 	sys/stat.h
-	sys/syscall.h
-	sys/sysmacros.h
 	sys/time.h
 	sys/types.h
-	sys/un.h
 	sys/wait.h
 ]))
 AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
@@ -885,7 +863,7 @@
 #include <sys/queue.h>
 #endif
 ]])
-AC_CHECK_HEADERS(net/if.h,,,
+AC_CHECK_HEADERS(,,,
 [[
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -1012,50 +990,13 @@
 fi
 dnl
 AC_CHECK_FUNCS(m4_flatten([
-	__secure_getenv
 	backtrace
-	blkid_probe_get_topology
-	chflags
-	fallocate
-	fallocate64
-	fchown
-	fdatasync
-	fstat64
-	ftruncate64
-	getdtablesize
-	getmntinfo
 	getpwuid_r
-	getrlimit
-	getrusage
-	jrand48
-	llseek
-	lseek64
-	mallinfo
-	mbstowcs
 	memalign
 	mmap
-	msync
 	nanosleep
-	open64
-	pathconf
-	posix_fadvise
-	posix_memalign
-	prctl
-	secure_getenv
-	setmntent
-	setresgid
-	setresuid
-	srandom
-	strcasecmp
 	strdup
-	strnlen
-	strptime
-	strtoull
-	sync_file_range
-	sysconf
 	usleep
-	utime
-	valloc
 ]))
 dnl
 dnl Check to see if -lsocket is required (solaris) to make something
diff -aur e2fsprogs-1.42.8/e2fsck/journal.c e2fsprogs/e2fsck/journal.c
--- e2fsprogs-1.42.8/e2fsck/journal.c	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/e2fsck/journal.c	2015-11-13 01:01:53.016768215 +0300
@@ -27,6 +27,8 @@
 #include "problem.h"
 #include "uuid/uuid.h"
 
+#include <arpa/inet.h>
+
 #ifdef CONFIG_JBD_DEBUG		/* Enabled by configure --enable-jfs-debug */
 static int bh_count = 0;
 #endif
diff -aur e2fsprogs-1.42.8/e2fsck/recovery.c e2fsprogs/e2fsck/recovery.c
--- e2fsprogs-1.42.8/e2fsck/recovery.c	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/e2fsck/recovery.c	2015-11-13 01:01:53.016768215 +0300
@@ -24,6 +24,8 @@
 #include <linux/slab.h>
 #endif
 
+#include <arpa/inet.h>
+
 /*
  * Maintain information about the progress of the recovery job, so that
  * the different passes can carry information between them.
diff -aur e2fsprogs-1.42.8/e2fsck/revoke.c e2fsprogs/e2fsck/revoke.c
--- e2fsprogs-1.42.8/e2fsck/revoke.c	2012-07-06 17:37:27.000000000 +0400
+++ e2fsprogs/e2fsck/revoke.c	2015-11-13 01:01:53.016768215 +0300
@@ -60,6 +60,7 @@
 #ifndef __KERNEL__
 #include "config.h"
 #include "jfs_user.h"
+#include <linux/list.h>
 #else
 #include <linux/sched.h>
 #include <linux/fs.h>
diff -aur e2fsprogs-1.42.8/e2fsck/unix.c e2fsprogs/e2fsck/unix.c
--- e2fsprogs-1.42.8/e2fsck/unix.c	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/e2fsck/unix.c	2015-11-13 01:31:46.068754987 +0300
@@ -838,7 +838,7 @@
 			/* What we do by default, anyway! */
 			break;
 		case 'b':
-			res = sscanf(optarg, "%llu", &ctx->use_superblock);
+			res = sscanf(optarg, "%d", &ctx->use_superblock);
 			if (res != 1)
 				goto sscanf_err;
 			ctx->flags |= E2F_FLAG_SB_SPECIFIED;
diff -aur e2fsprogs-1.42.8/lib/blkid/blkidP.h e2fsprogs/lib/blkid/blkidP.h
--- e2fsprogs-1.42.8/lib/blkid/blkidP.h	2012-07-06 17:37:27.000000000 +0400
+++ e2fsprogs/lib/blkid/blkidP.h	2015-11-13 01:01:53.020768215 +0300
@@ -18,7 +18,7 @@
 
 #include <blkid/blkid.h>
 
-#include <blkid/list.h>
+#include <linux/list.h>
 
 #ifdef __GNUC__
 #define __BLKID_ATTR(x) __attribute__(x)
diff -aur e2fsprogs-1.42.8/lib/blkid/blkid_types.h.in e2fsprogs/lib/blkid/blkid_types.h.in
--- e2fsprogs-1.42.8/lib/blkid/blkid_types.h.in	2012-08-15 07:24:21.000000000 +0400
+++ e2fsprogs/lib/blkid/blkid_types.h.in	2015-11-13 01:01:53.020768215 +0300
@@ -9,6 +9,8 @@
 
 @ASM_TYPES_HEADER@
 
+#if 0
+
 #ifdef __U8_TYPEDEF
 typedef __U8_TYPEDEF __u8;
 #else
@@ -131,4 +133,8 @@
 #undef __S64_TYPEDEF
 #undef __U64_TYPEDEF
 
+#endif
+
+#include <sys/types.h>
+
 #endif /* _*_TYPES_H */
diff -aur e2fsprogs-1.42.8/lib/blkid/dev.c e2fsprogs/lib/blkid/dev.c
--- e2fsprogs-1.42.8/lib/blkid/dev.c	2012-07-06 17:37:27.000000000 +0400
+++ e2fsprogs/lib/blkid/dev.c	2015-11-13 01:01:53.020768215 +0300
@@ -13,6 +13,7 @@
 #include "config.h"
 #include <stdlib.h>
 #include <string.h>
+#include <linux/list.h>
 
 #include "blkidP.h"
 
diff -aur e2fsprogs-1.42.8/lib/blkid/list.h e2fsprogs/lib/blkid/list.h
--- e2fsprogs-1.42.8/lib/blkid/list.h	2009-08-13 05:39:57.000000000 +0400
+++ e2fsprogs/lib/blkid/list.h	2015-11-13 01:01:53.020768215 +0300
@@ -1,6 +1,8 @@
 #if !defined(_BLKID_LIST_H) && !defined(LIST_HEAD)
 #define _BLKID_LIST_H
 
+#ifndef EMBOX
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -176,4 +178,6 @@
 }
 #endif
 
+#endif // EMBOX
+
 #endif /* _BLKID_LIST_H */
diff -aur e2fsprogs-1.42.8/lib/config.h.in e2fsprogs/lib/config.h.in
--- e2fsprogs-1.42.8/lib/config.h.in	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/lib/config.h.in	2015-11-13 01:01:53.020768215 +0300
@@ -621,3 +621,5 @@
 #undef uintmax_t
 
 #include "dirpaths.h"
+
+#include "embox_compat_config.h"
diff -aur e2fsprogs-1.42.8/lib/ext2fs/ext2_types.h.in e2fsprogs/lib/ext2fs/ext2_types.h.in
--- e2fsprogs-1.42.8/lib/ext2fs/ext2_types.h.in	2012-08-15 07:24:21.000000000 +0400
+++ e2fsprogs/lib/ext2fs/ext2_types.h.in	2015-11-13 01:01:53.020768215 +0300
@@ -9,6 +9,8 @@
 
 @ASM_TYPES_HEADER@
 
+#if 0
+
 #ifdef __U8_TYPEDEF
 typedef __U8_TYPEDEF __u8;
 #else
@@ -131,6 +133,10 @@
 #undef __S64_TYPEDEF
 #undef __U64_TYPEDEF
 
+#endif
+
+#include <sys/types.h>
+
 #endif /* _*_TYPES_H */
 
 @PUBLIC_CONFIG_HEADER@
diff -aur e2fsprogs-1.42.8/lib/ext2fs/kernel-list.h e2fsprogs/lib/ext2fs/kernel-list.h
--- e2fsprogs-1.42.8/lib/ext2fs/kernel-list.h	2012-07-06 17:37:27.000000000 +0400
+++ e2fsprogs/lib/ext2fs/kernel-list.h	2015-11-13 01:01:53.020768215 +0300
@@ -11,6 +11,8 @@
  * using the generic single-entry routines.
  */
 
+#ifndef EMBOX
+
 struct list_head {
 	struct list_head *next, *prev;
 };
@@ -109,4 +111,6 @@
 #define list_for_each(pos, head) \
         for (pos = (head)->next; pos != (head); pos = pos->next)
 
+#endif // EMBOX
+
 #endif
diff -aur e2fsprogs-1.42.8/lib/ext2fs/mkjournal.c e2fsprogs/lib/ext2fs/mkjournal.c
--- e2fsprogs-1.42.8/lib/ext2fs/mkjournal.c	2013-04-22 03:05:50.000000000 +0400
+++ e2fsprogs/lib/ext2fs/mkjournal.c	2015-11-13 01:01:53.020768215 +0300
@@ -38,6 +38,8 @@
 #include "ext2fs.h"
 #include "jfs_user.h"
 
+#include <arpa/inet.h>
+
 /*
  * This function automatically sets up the journal superblock and
  * returns it as an allocated block.
diff -aur e2fsprogs-1.42.8/lib/quota/quotaio.h e2fsprogs/lib/quota/quotaio.h
--- e2fsprogs-1.42.8/lib/quota/quotaio.h	2013-05-20 17:28:51.000000000 +0400
+++ e2fsprogs/lib/quota/quotaio.h	2015-11-13 01:01:53.020768215 +0300
@@ -9,6 +9,7 @@
 
 #include <limits.h>
 #include <sys/types.h>
+#include <stdint.h>
 #include <sys/stat.h>
 
 #include "ext2fs/ext2fs.h"
diff -aur e2fsprogs-1.42.8/lib/uuid/Makefile.in e2fsprogs/lib/uuid/Makefile.in
--- e2fsprogs-1.42.8/lib/uuid/Makefile.in	2012-07-31 02:41:44.000000000 +0400
+++ e2fsprogs/lib/uuid/Makefile.in	2015-11-13 01:01:53.020768215 +0300
@@ -67,7 +67,7 @@
 @ELF_CMT@	$(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
 @BSDLIB_CMT@	$(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
 
-all:: tst_uuid uuid_time $(SMANPAGES) uuid.pc
+all:: uuid_time $(SMANPAGES) uuid.pc
 
 uuid.h: $(srcdir)/uuid.h.in
 	$(E) "	CP $@"
diff -aur e2fsprogs-1.42.8/lib/uuid/uuid_types.h.in e2fsprogs/lib/uuid/uuid_types.h.in
--- e2fsprogs-1.42.8/lib/uuid/uuid_types.h.in	2009-08-13 05:39:57.000000000 +0400
+++ e2fsprogs/lib/uuid/uuid_types.h.in	2015-11-13 01:01:53.020768215 +0300
@@ -6,6 +6,8 @@
 #if (!defined(_STDINT_H) && !defined(_UUID_STDINT_H))
 #define _UUID_STDINT_H
 
+#if 0
+
 typedef unsigned char uint8_t;
 typedef signed char int8_t;
 
@@ -48,3 +50,7 @@
 #endif
 
 #endif
+
+#include <stdint.h>
+
+#endif
diff -aur e2fsprogs-1.42.8/Makefile.in e2fsprogs/Makefile.in
--- e2fsprogs-1.42.8/Makefile.in	2012-07-06 17:37:27.000000000 +0400
+++ e2fsprogs/Makefile.in	2015-11-13 01:01:53.016768215 +0300
@@ -15,9 +15,12 @@
 @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
 @QUOTA_CMT@QUOTA_LIB_SUBDIR= lib/quota
 
-LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl
-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
-SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
+#LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl
+#PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
+#SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
+PROG_SUBDIRS=e2fsck
+LIB_SUBDIRS=lib/et lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl
+SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS)
 
 SUBS= util/subst.conf lib/config.h lib/dirpaths.h \
 	lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
@@ -26,6 +29,10 @@
 
 all:: subs
 	$(MAKE) libs
+	$(MAKE) e2freefrag_prog
+	$(MAKE) dumpe2fs_prog
+	$(MAKE) mke2fs_prog
+	$(MAKE) badblocks_prog
 	$(MAKE) progs
 	$(MAKE) docs
 
@@ -39,6 +46,19 @@
 libs: all-libs-recursive
 all-progs-recursive all-libs-recursive: subs
 
+
+e2freefrag_prog:
+	cd misc && $(MAKE) e2freefrag
+	
+dumpe2fs_prog:
+	cd misc && $(MAKE) dumpe2fs
+	
+mke2fs_prog:
+	cd misc && $(MAKE) mke2fs
+	
+badblocks_prog:
+	cd misc && $(MAKE) badblocks
+
 e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
 	cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
 
diff -aur e2fsprogs-1.42.8/misc/dumpe2fs.c e2fsprogs/misc/dumpe2fs.c
--- e2fsprogs-1.42.8/misc/dumpe2fs.c	2013-06-21 06:43:42.000000000 +0400
+++ e2fsprogs/misc/dumpe2fs.c	2015-11-13 01:30:41.844755461 +0300
@@ -42,11 +42,12 @@
 
 #include "../version.h"
 #include "nls-enable.h"
+#include <arpa/inet.h>
 
 #define in_use(m, x)	(ext2fs_test_bit ((x), (m)))
 
-const char * program_name = "dumpe2fs";
-char * device_name = NULL;
+static const char * program_name = "dumpe2fs";
+static char * device_name = NULL;
 int hex_format = 0;
 int blocks64 = 0;
 
diff -aur e2fsprogs-1.42.8/misc/mke2fs.c e2fsprogs/misc/mke2fs.c
--- e2fsprogs-1.42.8/misc/mke2fs.c	2013-06-21 06:53:31.000000000 +0400
+++ e2fsprogs/misc/mke2fs.c	2015-11-13 01:01:53.020768215 +0300
@@ -76,8 +76,8 @@
 extern int isatty(int);
 extern FILE *fpopen(const char *cmd, const char *mode);
 
-const char * program_name = "mke2fs";
-const char * device_name /* = NULL */;
+static const char * program_name = "mke2fs";
+static const char * device_name /* = NULL */;
 
 /* Command line options */
 int	cflag;
@@ -2299,7 +2299,7 @@
 	return 0;
 }
 
-int main (int argc, char *argv[])
+int main_mke2fs (int argc, char *argv[])
 {
 	errcode_t	retval = 0;
 	ext2_filsys	fs;
@@ -2332,11 +2332,11 @@
 #endif
 		io_ptr = unix_io_manager;
 
-	if (should_do_undo(device_name)) {
-		retval = mke2fs_setup_tdb(device_name, &io_ptr);
-		if (retval)
-			exit(1);
-	}
+	//if (should_do_undo(device_name)) {
+	//	retval = mke2fs_setup_tdb(device_name, &io_ptr);
+	//	if (retval)
+	//		exit(1);
+	//}
 
 	/*
 	 * Initialize the superblock....
