summaryrefslogtreecommitdiffstats
path: root/system/ext4magic
diff options
context:
space:
mode:
author Andrew Clemons2022-02-05 04:45:32 +0100
committer Willy Sudiarto Raharjo2022-02-06 09:47:04 +0100
commitaf599fc9462de4c2859dbd373b81490ed3b6122c (patch)
treeb78e7291c3b5ce004cccc97a4cb0e21f1f6ba28d /system/ext4magic
parent31a033587dd2db58e74ca9c9bec2d941a764f70e (diff)
downloadslackbuilds-af599fc9462de4c2859dbd373b81490ed3b6122c.tar.gz
system/ext4magic: Fix build with newer gcc.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/ext4magic')
-rw-r--r--system/ext4magic/01-i_dir_acl.patch29
-rw-r--r--system/ext4magic/02-Fix-undefined-reference-to-makedev.patch30
-rw-r--r--system/ext4magic/ext4magic.SlackBuild5
3 files changed, 63 insertions, 1 deletions
diff --git a/system/ext4magic/01-i_dir_acl.patch b/system/ext4magic/01-i_dir_acl.patch
new file mode 100644
index 0000000000..37e9c47510
--- /dev/null
+++ b/system/ext4magic/01-i_dir_acl.patch
@@ -0,0 +1,29 @@
+From: Gokturk Yuksek <gokturk@gentoo.org>
+Subject: [PATCH] src/inode: supersede i_dir_acl with i_size_high
+
+The upstream has removed the macro that defined i_dir_acl as
+i_size_high which causes a build failure with the later versions of
+e2fsprogs. Replace every reference to inode->i_dir_acl with
+inode->i_size_high.
+
+[0] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=578fcbfd2e61e0b13ce8c7b62804c941d6c1eb8e
+
+--- a/src/inode.c
++++ b/src/inode.c
+@@ -404,14 +404,14 @@
+ fprintf(out,
+ "%sFile ACL: %d Directory ACL: %d Translator: %d\n",
+ prefix,
+- inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0,
++ inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0,
+ inode->osd1.hurd1.h_i_translator);
+ else
+ fprintf(out, "%sFile ACL: %llu Directory ACL: %d\n",
+ prefix,
+ inode->i_file_acl | ((long long)
+ (inode->osd2.linux2.l_i_file_acl_high) << 32),
+- LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0);
++ LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0);
+ if (os == EXT2_OS_LINUX)
+ fprintf(out, "%sLinks: %d Blockcount: %llu\n",
+ prefix, inode->i_links_count,
diff --git a/system/ext4magic/02-Fix-undefined-reference-to-makedev.patch b/system/ext4magic/02-Fix-undefined-reference-to-makedev.patch
new file mode 100644
index 0000000000..d3b4ba4016
--- /dev/null
+++ b/system/ext4magic/02-Fix-undefined-reference-to-makedev.patch
@@ -0,0 +1,30 @@
+From d412778d45774225ff4b36470193a6056ecc03cd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= <seblu@seblu.net>
+Date: Sun, 11 Nov 2018 14:42:38 +0100
+Subject: [PATCH] Fix undefined reference to `makedev'
+
+Add include to sys/sysmacros.h to fix compilation with gcc 8.2.1
+
+Error:
+gcc -O2 -g -D_FILE_OFFSET_BITS=64 -g -O2 -o ext4magic ext4magic-block.o ext4magic-dir_list.o ext4magic-ext4magic.o ext4magic-extent_db.o ext4magic-file_type.o ext4magic-hard_link_stack.o ext4magic-imap_search.o ext4magic-inode.o ext4magic-journal.o ext4magic-lookup_local.o ext4magic-magic_block_scan.o ext4magic-recover.o ext4magic-ring_buf.o ext4magic-util.o -le2p -luuid -lblkid -lz -lbz2 -lmagic -lext2fs
+/bin/ld: ext4magic-recover.o: in function `recover_file':
+/home/seblu/scm/foss/ext4magic/src/recover.c:478: undefined reference to `makedev'
+---
+ src/recover.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/recover.c b/src/recover.c
+index 41b4aee..30b5d8f 100644
+--- a/src/recover.c
++++ b/src/recover.c
+@@ -24,6 +24,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <utime.h>
++#include <sys/sysmacros.h>
+
+ #ifndef O_LARGEFILE
+ #define O_LARGEFILE 0
+--
+2.19.1
+
diff --git a/system/ext4magic/ext4magic.SlackBuild b/system/ext4magic/ext4magic.SlackBuild
index 4125ebdc31..34de5c3da7 100644
--- a/system/ext4magic/ext4magic.SlackBuild
+++ b/system/ext4magic/ext4magic.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ext4magic
VERSION=${VERSION:-0.3.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -72,6 +72,9 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
+# thanks arch maintainers
+patch -p1 < $CWD/01-i_dir_acl.patch
+patch -p1 < $CWD/02-Fix-undefined-reference-to-makedev.patch
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \