Skip to content

Commit 1a71840

Browse files
committed
tools: e2fsprogs: Update to version 1.47.3
Changelog: https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.3 Add patch to fix build on older Linux systems like Debian oldstable. Link: openwrt/openwrt#20541 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 6d04c7b commit 1a71840

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

tools/e2fsprogs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=e2fsprogs
1111
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
12-
PKG_VERSION:=1.47.2
13-
PKG_HASH:=08242e64ca0e8194d9c1caad49762b19209a06318199b63ce74ae4ef2d74e63c
12+
PKG_VERSION:=1.47.3
13+
PKG_HASH:=857e6ef800feaa2bb4578fbc810214be5d3c88b072ea53c5384733a965737329
1414

1515
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
1616
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Hauke Mehrtens <[email protected]>
3+
Date: Sat, 25 Oct 2025 19:59:58 +0200
4+
Subject: create_inode: Fix compilation again kernel < 5.12
5+
6+
Copy the header definition from Linux kernel v5.12 to allow compilation
7+
against kernel headers from an kernel older than v5.12.
8+
9+
struct fsverity_descriptor was already added in kernel 5.11, compiling
10+
against kernel 5.11 kernel headers could cause problems.
11+
12+
Signed-off-by: Hauke Mehrtens <[email protected]>
13+
---
14+
misc/create_inode.c | 47 +++++++++++++++++++++++++++++++++++++++++++++
15+
1 file changed, 47 insertions(+)
16+
17+
--- a/misc/create_inode.c
18+
+++ b/misc/create_inode.c
19+
@@ -575,6 +575,53 @@ static inline off_t round_up(off_t n, of
20+
return ((n - bias + (blksz - 1)) & ~(blksz - 1)) + bias;
21+
}
22+
23+
+#ifndef FS_IOC_READ_VERITY_METADATA
24+
+
25+
+/*
26+
+ * Struct containing a file's Merkle tree properties. The fs-verity file digest
27+
+ * is the hash of this struct. A userspace program needs this struct only if it
28+
+ * needs to compute fs-verity file digests itself, e.g. in order to sign files.
29+
+ * It isn't needed just to enable fs-verity on a file.
30+
+ *
31+
+ * Note: when computing the file digest, 'sig_size' and 'signature' must be left
32+
+ * zero and empty, respectively. These fields are present only because some
33+
+ * filesystems reuse this struct as part of their on-disk format.
34+
+ */
35+
+struct fsverity_descriptor {
36+
+ __u8 version; /* must be 1 */
37+
+ __u8 hash_algorithm; /* Merkle tree hash algorithm */
38+
+ __u8 log_blocksize; /* log2 of size of data and tree blocks */
39+
+ __u8 salt_size; /* size of salt in bytes; 0 if none */
40+
+#ifdef __KERNEL__
41+
+ __le32 sig_size;
42+
+#else
43+
+ __le32 __reserved_0x04; /* must be 0 */
44+
+#endif
45+
+ __le64 data_size; /* size of file the Merkle tree is built over */
46+
+ __u8 root_hash[64]; /* Merkle tree root hash */
47+
+ __u8 salt[32]; /* salt prepended to each hashed block */
48+
+ __u8 __reserved[144]; /* must be 0's */
49+
+#ifdef __KERNEL__
50+
+ __u8 signature[];
51+
+#endif
52+
+};
53+
+
54+
+#define FS_VERITY_METADATA_TYPE_MERKLE_TREE 1
55+
+#define FS_VERITY_METADATA_TYPE_DESCRIPTOR 2
56+
+#define FS_VERITY_METADATA_TYPE_SIGNATURE 3
57+
+
58+
+struct fsverity_read_metadata_arg {
59+
+ __u64 metadata_type;
60+
+ __u64 offset;
61+
+ __u64 length;
62+
+ __u64 buf_ptr;
63+
+ __u64 __reserved;
64+
+};
65+
+
66+
+#define FS_IOC_READ_VERITY_METADATA \
67+
+ _IOWR('f', 135, struct fsverity_read_metadata_arg)
68+
+#endif
69+
+
70+
static errcode_t copy_fs_verity_data(ext2_file_t e2_file, ext2_off_t e2_offset,
71+
int fd, uint64_t metadata_type,
72+
__u32 *written)

0 commit comments

Comments
 (0)