Skip to content

Commit

Permalink
Port mint patch to 1.47.1
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Aug 10, 2024
1 parent 950a0d6 commit 65c1360
Show file tree
Hide file tree
Showing 24 changed files with 1,724 additions and 58 deletions.
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu

if test "$GCC" = yes; then
RDYNAMIC="-rdynamic"
RDYNAMIC=""

fi
ac_ext=c
Expand Down Expand Up @@ -14809,7 +14809,7 @@ fi
printf "%s\n" "$UNI_DIFF_OPTS" >&6; }

case "$host_os" in
linux*)
linux*|mint*)

printf "%s\n" "#define HAVE_EXT2_IOCTLS 1" >>confdefs.h

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
dnl
AC_PROG_CC
if test "$GCC" = yes; then
RDYNAMIC="-rdynamic"
RDYNAMIC=""
AC_SUBST(RDYNAMIC)
fi
AC_PROG_CPP
Expand Down Expand Up @@ -1500,7 +1500,7 @@ dnl
dnl We use the EXT2 ioctls only under Linux
dnl
case "$host_os" in
linux*)
linux*|mint*)
AC_DEFINE(HAVE_EXT2_IOCTLS, 1, [Define to 1 if Ext2 ioctls present])
;;
esac
Expand Down
12 changes: 6 additions & 6 deletions debugfs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ debugfs.o: $(srcdir)/debugfs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/quotaio_tree.h $(top_srcdir)/version.h \
$(srcdir)/../e2fsck/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
$(top_srcdir)/lib/ext2fs/compiler.h $(top_srcdir)/lib/support/plausible.h
$(top_srcdir)/lib/ext2fs/e2_compiler.h $(top_srcdir)/lib/support/plausible.h
util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ss/ss.h \
$(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
Expand Down Expand Up @@ -286,7 +286,7 @@ logdump.o: $(srcdir)/logdump.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h $(srcdir)/../e2fsck/jfs_user.h \
$(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/compiler.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/e2_compiler.h \
$(top_srcdir)/lib/ext2fs/fast_commit.h
htree.o: $(srcdir)/htree.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
Expand Down Expand Up @@ -408,7 +408,7 @@ journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
$(top_srcdir)/lib/ext2fs/compiler.h
$(top_srcdir)/lib/ext2fs/e2_compiler.h
revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Expand All @@ -418,7 +418,7 @@ revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
$(top_srcdir)/lib/ext2fs/compiler.h
$(top_srcdir)/lib/ext2fs/e2_compiler.h
recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
Expand All @@ -428,7 +428,7 @@ recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
$(top_srcdir)/lib/ext2fs/compiler.h
$(top_srcdir)/lib/ext2fs/e2_compiler.h
do_journal.o: $(srcdir)/do_journal.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
$(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
Expand All @@ -441,5 +441,5 @@ do_journal.o: $(srcdir)/do_journal.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h \
$(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/compiler.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/e2_compiler.h \
$(srcdir)/journal.h $(srcdir)/../e2fsck/jfs_user.h
56 changes: 28 additions & 28 deletions e2fsck/Makefile.in

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions e2fsck/sigcatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* %End-Header%
*/

#ifndef __MINT__
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -444,3 +445,4 @@ int main(int argc, char** argv)
exit(0);
}
#endif
#endif
2 changes: 2 additions & 0 deletions e2fsck/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,9 @@ int main (int argc, char *argv[])
struct ext2fs_journal_params jparams;

clear_problem_context(&pctx);
#ifndef __MINT__
sigcatcher_setup();
#endif
#ifdef MTRACE
mtrace();
#endif
Expand Down
4 changes: 2 additions & 2 deletions lib/e2p/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ feature.o: $(srcdir)/feature.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
$(top_srcdir)/lib/ext2fs/compiler.h
$(top_srcdir)/lib/ext2fs/e2_compiler.h
fgetflags.o: $(srcdir)/fgetflags.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
Expand Down Expand Up @@ -173,7 +173,7 @@ ljs.o: $(srcdir)/ljs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
$(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/e2p.h \
$(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/compiler.h
$(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/e2_compiler.h
mntopts.o: $(srcdir)/mntopts.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2p.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h
Expand Down
25 changes: 15 additions & 10 deletions lib/ext2fs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ OBJS= $(DEBUGFS_LIB_OBJS) $(RESIZE_LIB_OBJS) $(E2IMAGE_LIB_OBJS) \
unlink.o \
valid_blk.o \
version.o \
rbtree.o
rbtree.o \
mint_io.o \
xhdi.o


SRCS= ext2_err.c \
$(srcdir)/alloc.c \
Expand Down Expand Up @@ -229,6 +232,8 @@ SRCS= ext2_err.c \
$(srcdir)/version.c \
$(srcdir)/write_bb_file.c \
$(srcdir)/rbtree.c \
$(srcdir)/mint_io.c \
$(srcdir)/xhdi.o \
$(srcdir)/tst_libext2fs.c \
$(DEBUG_SRCS)

Expand Down Expand Up @@ -740,7 +745,7 @@ blkmap64_rb.o: $(srcdir)/blkmap64_rb.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
$(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_ext_attr.h \
$(srcdir)/hashmap.h $(srcdir)/bitops.h $(srcdir)/bmap64.h $(srcdir)/rbtree.h \
$(srcdir)/compiler.h
$(srcdir)/e2_compiler.h
block.o: $(srcdir)/block.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fs.h \
Expand Down Expand Up @@ -1026,7 +1031,7 @@ mkjournal.o: $(srcdir)/mkjournal.c $(top_builddir)/lib/config.h \
$(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
$(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_ext_attr.h \
$(srcdir)/hashmap.h $(srcdir)/bitops.h $(srcdir)/kernel-jbd.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/compiler.h
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/e2_compiler.h
mmp.o: $(srcdir)/mmp.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fs.h \
Expand Down Expand Up @@ -1226,7 +1231,7 @@ write_bb_file.o: $(srcdir)/write_bb_file.c $(top_builddir)/lib/config.h \
$(srcdir)/ext2_fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h
rbtree.o: $(srcdir)/rbtree.c $(srcdir)/rbtree.h $(srcdir)/compiler.h
rbtree.o: $(srcdir)/rbtree.c $(srcdir)/rbtree.h $(srcdir)/e2_compiler.h
tst_libext2fs.o: $(srcdir)/tst_libext2fs.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/ext2fsP.h \
Expand Down Expand Up @@ -1257,7 +1262,7 @@ debugfs.o: $(top_srcdir)/debugfs/debugfs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/quotaio.h $(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h $(top_srcdir)/debugfs/../version.h \
$(srcdir)/../../e2fsck/jfs_user.h $(srcdir)/kernel-jbd.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/compiler.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/e2_compiler.h \
$(top_srcdir)/lib/support/plausible.h
util.o: $(top_srcdir)/debugfs/util.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ss/ss.h \
Expand Down Expand Up @@ -1348,7 +1353,7 @@ logdump.o: $(top_srcdir)/debugfs/logdump.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/support/quotaio.h $(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h $(srcdir)/../../e2fsck/jfs_user.h \
$(srcdir)/kernel-jbd.h $(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h \
$(srcdir)/compiler.h $(srcdir)/fast_commit.h
$(srcdir)/e2_compiler.h $(srcdir)/fast_commit.h
htree.o: $(top_srcdir)/debugfs/htree.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/debugfs/debugfs.h \
$(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
Expand Down Expand Up @@ -1462,23 +1467,23 @@ journal.o: $(top_srcdir)/debugfs/journal.c $(top_builddir)/lib/config.h \
$(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h $(srcdir)/ext2_io.h \
$(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/ext2_ext_attr.h \
$(srcdir)/hashmap.h $(srcdir)/bitops.h $(srcdir)/kernel-jbd.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/compiler.h
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/e2_compiler.h
revoke.o: $(top_srcdir)/e2fsck/revoke.c $(top_srcdir)/e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(srcdir)/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(srcdir)/ext2fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h \
$(srcdir)/kernel-jbd.h $(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h \
$(srcdir)/compiler.h
$(srcdir)/e2_compiler.h
recovery.o: $(top_srcdir)/e2fsck/recovery.c $(top_srcdir)/e2fsck/jfs_user.h \
$(top_builddir)/lib/config.h $(top_builddir)/lib/dirpaths.h \
$(srcdir)/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(srcdir)/ext2fs.h $(srcdir)/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(srcdir)/ext2_ext_attr.h $(srcdir)/hashmap.h $(srcdir)/bitops.h \
$(srcdir)/kernel-jbd.h $(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h \
$(srcdir)/compiler.h
$(srcdir)/e2_compiler.h
do_journal.o: $(top_srcdir)/debugfs/do_journal.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/debugfs/debugfs.h \
$(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
Expand All @@ -1490,5 +1495,5 @@ do_journal.o: $(top_srcdir)/debugfs/do_journal.c $(top_builddir)/lib/config.h \
$(top_srcdir)/debugfs/../misc/create_inode.h $(top_srcdir)/lib/e2p/e2p.h \
$(top_srcdir)/lib/support/quotaio.h $(top_srcdir)/lib/support/dqblk_v2.h \
$(top_srcdir)/lib/support/quotaio_tree.h $(srcdir)/kernel-jbd.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/compiler.h \
$(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h $(srcdir)/e2_compiler.h \
$(top_srcdir)/debugfs/journal.h $(srcdir)/../../e2fsck/jfs_user.h
1 change: 1 addition & 0 deletions lib/ext2fs/bmap64.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* %End-Header%
*/

#include <sys/time.h> /* for timeval */
struct ext2_bmap_statistics {
int type;
struct timeval created;
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions lib/ext2fs/ext2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ struct ext4_new_group_input {
#define _IOT_ext2_new_group_input _IOT (_IOTS(__u32), 5, _IOTS(__u16), 2, 0, 0)
#endif

#ifndef __MINT__
#define EXT2_IOC_GETFLAGS _IOR('f', 1, long)
#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
#define EXT2_IOC_GETVERSION _IOR('v', 1, long)
Expand All @@ -397,6 +398,9 @@ struct ext4_new_group_input {
#define EXT2_IOC_GROUP_ADD _IOW('f', 8,struct ext2_new_group_input)
#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
#else
#include <mint/dcntl.h>
#endif

/*
* Structure of an inode on the disk
Expand Down
5 changes: 5 additions & 0 deletions lib/ext2fs/getsize.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
#define BLKGETSIZE DKIOCGETBLOCKCOUNT32
#endif /* APPLE_DARWIN */

#ifdef __MINT__
#include <sys/ioctl.h>
#include "mint_io.h"
#endif

#include "ext2_fs.h"
#include "ext2fs.h"

Expand Down
2 changes: 1 addition & 1 deletion lib/ext2fs/kernel-list.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H

#include "compiler.h"
#include "e2_compiler.h"

/*
* Simple doubly linked list implementation.
Expand Down
4 changes: 4 additions & 0 deletions lib/ext2fs/llseek.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin)

#else /* !linux */

#ifndef __MINT__

#ifndef EINVAL
#define EINVAL EXT2_ET_INVALID_ARGUMENT
#endif
Expand All @@ -103,6 +105,8 @@ ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin)
#endif
}

#endif /* __MINT__ */

#endif /* linux */


Loading

0 comments on commit 65c1360

Please sign in to comment.