sys-fs/e2fsprogs: Sync with Gentoo

It's from Gentoo commit 2f317399a60cc5a99062e7932317183f4ef81b65.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
Flatcar Buildbot 2025-07-21 07:18:07 +00:00 committed by Mathieu Tortuyaux
parent e51eaf8b2c
commit aea5ca179b
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8
4 changed files with 212 additions and 1 deletions

View File

@ -1 +1,2 @@
DIST e2fsprogs-1.47.2.tar.xz 7299932 BLAKE2B 20f93b53c18396dbbf8a9564fd80181e391120554bd63a76c90c88d32616596fb7cf8e1252417b835ef3918ecf3211aebdd7a75daebee11bcb6e7b0f9bd88053 SHA512 a32632e072e535bf164503cf9992a4da7ea971e80f8f84ead4e7bc8899a92c27e4670bdebef1de0187596672e44af7b96078888e0cd4eefa3e3f551344d434d8 DIST e2fsprogs-1.47.2.tar.xz 7299932 BLAKE2B 20f93b53c18396dbbf8a9564fd80181e391120554bd63a76c90c88d32616596fb7cf8e1252417b835ef3918ecf3211aebdd7a75daebee11bcb6e7b0f9bd88053 SHA512 a32632e072e535bf164503cf9992a4da7ea971e80f8f84ead4e7bc8899a92c27e4670bdebef1de0187596672e44af7b96078888e0cd4eefa3e3f551344d434d8
DIST e2fsprogs-1.47.3.tar.xz 7321540 BLAKE2B 5d83a47d24f28fb4e0a6e8a145b146e6ff0de4463a16720790041f6fe750e595d749e730016bc3a9255c9ed3172b15e37f0fa8af4e8463f724f6bd221a9fa161 SHA512 1139b793cfa2f1af4e8ef06439522ff5aa3bab701201f2a4ef74910eb0c4d8c86dbd40d5a8bdc798dc52f121a0ca9e454eda0c6058e2dc5d4a25e82f669e96ae

View File

@ -11,7 +11,7 @@ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/$
LICENSE="GPL-2 BSD" LICENSE="GPL-2 BSD"
SLOT="0" SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux" KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="archive cron fuse nls static-libs test +tools" IUSE="archive cron fuse nls static-libs test +tools"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"

View File

@ -0,0 +1,169 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal systemd toolchain-funcs udev
DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
HOMEPAGE="http://e2fsprogs.sourceforge.net/"
SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz"
LICENSE="GPL-2 BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="archive cron fuse nls static-libs test +tools"
RESTRICT="!test? ( test )"
RDEPEND="
!sys-libs/${PN}-libs
archive? ( app-arch/libarchive:= )
cron? ( sys-fs/lvm2[lvm] )
fuse? ( sys-fs/fuse:3= )
nls? ( virtual/libintl )
tools? ( sys-apps/util-linux )
"
# For testing lib/ext2fs, lib/support/libsupport.a is required, which
# unconditionally includes '<blkid/blkid.h>' from sys-apps/util-linux.
DEPEND="
${RDEPEND}
test? ( sys-apps/util-linux[${MULTILIB_USEDEP}] )
"
BDEPEND="
sys-apps/texinfo
virtual/pkgconfig
nls? ( sys-devel/gettext )
"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/ext2fs/ext2_types.h
)
PATCHES=(
"${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch # bug #516854
# Upstream patches (can usually removed with next version bump)
"${FILESDIR}"/${PN}-1.47.3-e2scrub-order.patch
)
src_prepare() {
default
cp doc/RelNotes/v${PV}.txt ChangeLog || die "Failed to copy Release Notes"
# Get rid of doc -- we don't use them. This also prevents a sandbox
# violation due to mktexfmt invocation
rm -r doc || die "Failed to remove doc dir"
# Prevent included intl cruft from building, bug #81096
sed -i -r \
-e 's:@LIBINTL@:@LTLIBINTL@:' \
MCONFIG.in || die 'intl cruft'
}
multilib_src_configure() {
# Keep the package from doing silly things, bug #261411
export VARTEXFONTS="${T}/fonts"
local myeconfargs=(
--with-root-prefix="${EPREFIX}"
$(use_with cron crond-dir "${EPREFIX}/etc/cron.d")
--with-systemd-unit-dir="$(systemd_get_systemunitdir)"
--with-udev-rules-dir="${EPREFIX}$(get_udevdir)/rules.d"
--enable-symlink-install
--enable-elf-shlibs
$(tc-has-tls || echo --disable-tls)
$(multilib_native_use_with archive libarchive direct)
$(multilib_native_use_enable fuse fuse2fs)
$(use_enable nls)
$(multilib_native_use_enable tools e2initrd-helper)
--disable-fsck
--disable-uuidd
--disable-lto
--with-pthread
--enable-largefile
)
# We use blkid/uuid from util-linux now
if use kernel_linux ; then
export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes
myeconfargs+=( --disable-lib{blkid,uuid} )
fi
ac_cv_path_LDCONFIG=: \
ECONF_SOURCE="${S}" \
CC="$(tc-getCC)" \
BUILD_CC="$(tc-getBUILD_CC)" \
BUILD_LD="$(tc-getBUILD_LD)" \
econf "${myeconfargs[@]}"
if grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
eerror "INTL sanity check failed, aborting build."
eerror "Please post your ${S}/config.log file as an"
eerror "attachment to https://bugs.gentoo.org/81096"
die "Preventing included intl cruft from building"
fi
}
multilib_src_compile() {
# Parallel make issue (bug #936493)
emake -C lib/et V=1 compile_et
emake -C lib/ext2fs V=1 ext2_err.h
if multilib_is_native_abi && use tools ; then
emake V=1
else
emake -C lib/et V=1
emake -C lib/ss V=1
emake -C lib/ext2fs V=1
emake -C lib/e2p V=1
fi
}
multilib_src_test() {
if multilib_is_native_abi && use tools ; then
emake V=1 check
else
# Required by lib/ext2fs's check target
emake -C lib/support V=1
# For non-native, there's no binaries to test. Just libraries.
emake -C lib/et V=1 check
emake -C lib/ss V=1 check
emake -C lib/ext2fs V=1 check
emake -C lib/e2p V=1 check
fi
}
multilib_src_install() {
if multilib_is_native_abi && use tools ; then
emake STRIP=':' V=1 DESTDIR="${D}" install
else
emake -C lib/et V=1 DESTDIR="${D}" install
emake -C lib/ss V=1 DESTDIR="${D}" install
emake -C lib/ext2fs V=1 DESTDIR="${D}" install
emake -C lib/e2p V=1 DESTDIR="${D}" install
fi
# configure doesn't have an option to disable static libs
if ! use static-libs ; then
find "${ED}" -name '*.a' -delete || die
fi
}
multilib_src_install_all() {
einstalldocs
if use tools ; then
insinto /etc
doins "${FILESDIR}"/e2fsck.conf
fi
}
pkg_postinst() {
udev_reload
}
pkg_postrm() {
udev_reload
}

View File

@ -0,0 +1,41 @@
https://github.com/tytso/e2fsprogs/commit/fb9b2e7c9cf90e2c4eabcf1cffbde443e8eeb360
From fb9b2e7c9cf90e2c4eabcf1cffbde443e8eeb360 Mon Sep 17 00:00:00 2001
From: Samuel Smith <satlug@net153.net>
Date: Fri, 4 Jul 2025 22:38:21 -0500
Subject: [PATCH] e2scrub: reorder exit status check after calling lvremove
Checking for snapshot device existence resets the status code in $?.
Reording the conditions will allow the retry loop to work properly.
Signed-off-by: Samuel Smith <satlug@net153.net>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20250705033821.3695205-1-satlug@net153.net
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
scrub/e2scrub.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in
index 043bc12b3..6f9b5ce2a 100644
--- a/scrub/e2scrub.in
+++ b/scrub/e2scrub.in
@@ -182,7 +182,7 @@ snap_dev="/dev/${LVM2_VG_NAME}/${snap}"
teardown() {
# Remove and wait for removal to succeed.
${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}"
- while [ -e "${snap_dev}" ] && [ "$?" -eq "5" ]; do
+ while [ "$?" -eq "5" ] && [ -e "${snap_dev}" ]; do
sleep 0.5
${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}"
done
@@ -210,7 +210,7 @@ setup() {
# Try to remove snapshot for 30s, bail out if we can't remove it.
lvremove_deadline="$(( $(date "+%s") + 30))"
${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}" 2>/dev/null
- while [ -e "${snap_dev}" ] && [ "$?" -eq "5" ] &&
+ while [ "$?" -eq "5" ] && [ -e "${snap_dev}" ] &&
[ "$(date "+%s")" -lt "${lvremove_deadline}" ]; do
sleep 0.5
${DBG} lvremove -f "${LVM2_VG_NAME}/${snap}"