Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Aug 2021 20:58:36 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Matthias Andree <mandree@FreeBSD.org>
Cc:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   Re: git: 54b26298c822 - main - sysutils/e2fsprogs: port rework
Message-ID:  <93738b88-4f35-4e56-b220-25026f9cd62f@FreeBSD.org>
In-Reply-To: <202108042123.174LNOj4042456@gitrepo.freebsd.org>
References:  <202108042123.174LNOj4042456@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

4 ao=C3=BBt 2021 23:23:27 Matthias Andree <mandree@FreeBSD.org>:

> The branch main has been updated by mandree:
>
> URL: https://cgit.FreeBSD.org/ports/commit/?id=3D54b26298c82275501e6dcc6c=
733d21c0a6bf0d9f
>
> commit 54b26298c82275501e6dcc6c733d21c0a6bf0d9f
> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Matthias Andree <mandree@FreeBSD.org>
> AuthorDate: 2021-08-04 20:09:19 +0000
> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Matthias Andree <mandree@FreeBSD.org>
> CommitDate: 2021-08-04 21:23:08 +0000
>
> =C2=A0=C2=A0=C2=A0 sysutils/e2fsprogs: port rework
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0 1 - sysutils/e2fsprogs: fix checksum mismatches
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 e2fsprogs has replaced symlink=
s by hardlinks in its post-install if
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /sbin and ${PREFIX}/sbin were =
on the same file system, and unless
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 script processing was defeated=
 on install or upgrade.
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Leave symlinks in place to avo=
id checksum mismatches.
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0 PR:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 252184 [1]

We already discuss this, the problem here is what this package is doing, in=
stalling in base is a violation of the ports tree rules in 99% of the case =
if not 100%. The purpose of this installation of hardlinksto only support a=
 case which is known not to be functionnal: using e2fs family as a root fil=
esystem for freebsd is a bad reason to do it. Either install everything in =
base or in localbase but do not do both.

Running pkg check -r is even worse.
1/ i am not sure it works are both pkg install and pkg check will attempt t=
o get an exclusive lock o' the db
2/ by design is defeats the principle why we are having checksums on pkg

Bapt
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0 2 - add FLAVORS for /sbin handling
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - no flavor (default): set sym=
links from $PREFIX/sbin to /sbin
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - roothardlinks: set hardlinks=
 from $PREFIX/sbin to /sbin, when
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $PREFIX, its child=
ren, and /sbin reside on the same file system
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - nobootfsck: do not install i=
nto /sbin, but this makes fsck
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unavailable for ex=
t2/ext3/ext4 file systems before $PREFIX/ is
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mounted
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0 Require tests on i386 and amd64 only for FreeBSD >=3D =
14 (not >=3D 12).
> =C2=A0=C2=A0=C2=A0
> =C2=A0=C2=A0=C2=A0 Do not print removal advice from post-uninstall on upg=
rades.
> ---
> sysutils/e2fsprogs/Makefile=C2=A0=C2=A0=C2=A0 | 40 ++++++++++++++++++++++=
+++++++++++++++---
> sysutils/e2fsprogs/pkg-install | 21 ++-------------------
> sysutils/e2fsprogs/pkg-plist=C2=A0=C2=A0 |=C2=A0 4 ++--
> 3 files changed, 41 insertions(+), 24 deletions(-)
>
> diff --git a/sysutils/e2fsprogs/Makefile b/sysutils/e2fsprogs/Makefile
> index 2d8c3dbf78be..577ecec3b840 100644
> --- a/sysutils/e2fsprogs/Makefile
> +++ b/sysutils/e2fsprogs/Makefile
> @@ -1,4 +1,16 @@
> # Created by: Maxim Sobolev <sobomax@FreeBSD.org>
> +# heavily modified by: Matthias Andree <mandree@FreeBSD.org>
> +#
> +# supported FLAVORS=3D default nobootfsck roothardlinks
> +# FLAVORS explained:
> +# default=C2=A0 - install e2fsck fsck_ext2fs into /sbin and symlink from=
 PREFIX
> +#=C2=A0=C2=A0=C2=A0 - requires that / is writable
> +#
> +# roothardlinks - install e2fsck fsck_ext2fs into /sbin and hardlink fro=
m PREFIX
> +#=C2=A0=C2=A0=C2=A0 - requires that / is writable and the same file syst=
em as PREFIX
> +#
> +# nobootfsck - does not install into /sbin, but will be unable to fsck
> +#=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ext2/ext3/ext4 file systems at boot, bef=
ore PREFIX is mounted
>
> PORTNAME=3D=C2=A0 e2fsprogs
> PORTVERSION=3D 1.46.3
> @@ -98,6 +110,13 @@ MAKE_ARGS+=3D V=3D1
>
> .include <bsd.port.options.mk>
>
> +.if ${MASTERDIR} =3D=3D ${.CURDIR}
> +FLAVORS=3D default nobootfsck roothardlinks
> +FLAVOR?=3D ${FLAVORS:[1]}
> +nobootfsck_PKGNAMESUFFIX=3D=C2=A0 -nobootfsck
> +roothardlinks_PKGNAMESUFFIX=3D -roothardlinks
> +.endif
> +
> . if ! empty(ARCH:Mpowerpc*)
> # Fix powerpc64/powerpc SIGSEGV,
> # see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231570 (ppc64)
> @@ -197,7 +216,13 @@ post-patch::
> .if ${MASTERDIR} =3D=3D ${.CURDIR}
> # NOTE: The previous .if block goes all the way to the end of the file.
>
> -.if !empty(PORT_OPTIONS:MNOTESTS) && (${OPSYS} =3D=3D FreeBSD) && (${OSV=
ERSION} >=3D 1200000 || ((${ARCH} !=3D i386) && (${ARCH} !=3D amd64)))
> +.if ${FLAVOR} =3D=3D nobootfsck
> +PLIST_SUB+=3D=C2=A0 ROOTSBIN=3D"@comment "
> +.else
> +PLIST_SUB+=3D=C2=A0 ROOTSBIN=3D""
> +.endif
> +
> +.if !empty(PORT_OPTIONS:MNOTESTS) && (${OPSYS} =3D=3D FreeBSD) && (${OSV=
ERSION} >=3D 1400000 || ((${ARCH} !=3D i386) && (${ARCH} !=3D amd64)))
> BROKEN=3D=C2=A0 it was not tested on your system by the maintainer; you m=
ust run self-tests
> .endif
>
> @@ -295,13 +320,22 @@ post-install:
> =C2=A0 # in the regular hierarchy, normally $PREFIX/sbin. Hard links may
> =C2=A0 # crash the install if /usr[/local] is a separate file system from=
 /,
> =C2=A0 # and pkg 1.15.4 can't automatically unroll or install relative sy=
mlinks.
> +.if ${FLAVOR} !=3D nobootfsck
> =C2=A0 ${MKDIR} ${STAGEDIR}/sbin
> =C2=A0 ${MV} -f ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}/sbin/ # from=
 INSTALL_TARGET
> =C2=A0 ${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}/sbin/=C2=A0 #=
 from port
> - # according to TPH 6.1.1 Handling Symbolic Links, these are to be absol=
ute,
> - # yet stage-qa warns about these on 2020-09-16:
> + # according to TPH 6.1.1 Handling Symbolic Links, these are to be absol=
ute
> + # for the default FLAVOR, yet stage-qa warns about these on 2020-09-16.
> +. if ${FLAVOR} =3D=3D roothardlinks
> + ${LN} -f ${STAGEDIR}/sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
> + ${LN} -f ${STAGEDIR}/sbin/e2fsck=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${STAGED=
IR}${PREFIX}/sbin/
> +. else
> =C2=A0 ${LN} -fs /sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
> =C2=A0 ${LN} -fs /sbin/e2fsck=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ${STAGEDIR}${=
PREFIX}/sbin/
> +. endif
> +.else
> + ${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/
> +.endif
> =C2=A0 # these are made hardlinks to symlinks - -P avoids following them =
to /sbin:
> =C2=A0 ${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sb=
in/fsck.ext2
> =C2=A0 ${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sb=
in/fsck.ext3
> diff --git a/sysutils/e2fsprogs/pkg-install b/sysutils/e2fsprogs/pkg-inst=
all
> index 25259ebfc8a3..34a21e9364f0 100644
> --- a/sysutils/e2fsprogs/pkg-install
> +++ b/sysutils/e2fsprogs/pkg-install
> @@ -6,23 +6,6 @@ MODE=3D"$2" # PRE-INSTALL, POST-INSTALL, DEINSTALL, POST=
-DEINSTALL
>
> case "$MODE" in
> POST-INSTALL)
> - # try to replace the e2fsck and its wrapper, fsck_ext2fs,
> - # symbolic links by hard links if possible (pkg ships them as symlinks)
> - d1=3D${PKG_ROOTDIR}/sbin/ ;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dev1=3D$(stat -Lf %Xd "$d1")
> - d2=3D${PKG_ROOTDIR}${PKG_PREFIX}/sbin/ ; dev2=3D$(stat -Lf %Xd "$d2")
> - if [ "$dev1" =3D "$dev2" ] && [ "$(realpath "$d1")" !=3D "$(realpath "$=
d2")" ]; then
> -=C2=A0=C2=A0 for i in e2fsck fsck_ext2fs ; do
> -=C2=A0=C2=A0=C2=A0=C2=A0 ln -fhP ${d1}${i} ${d2}${i}
> -=C2=A0=C2=A0 done
> -=C2=A0=C2=A0 for i in ext2 ext3 ext4 ; do
> -=C2=A0=C2=A0=C2=A0=C2=A0 ln -fhP ${d2}e2fsck ${d2}fsck.$i
> -=C2=A0=C2=A0 done
> -=C2=A0=C2=A0 echo >&2 "NOTE: replaced e2fsprogs symlinks by hard links, =
will recalculate checksums with a root at(1) job."
> -=C2=A0=C2=A0 pid=3D$$
> -=C2=A0=C2=A0 echo /bin/sh -c "\"set -x ; { while sleep 2 </dev/null ; do=
 kill -0 $pid || break ; done ; \
> -=C2=A0=C2=A0=C2=A0=C2=A0 pkg check -r "${PKG_NAME}" ; } </dev/null 2>&1 =
| logger -t pkg.e2fsprogs.POST-INSTALL \"" \
> -=C2=A0=C2=A0=C2=A0=C2=A0 | at now
> - fi
> =C2=A0 #
> =C2=A0 # install configuration file and update config files from
> =C2=A0 # old "ext4dev" to current "ext4" name.
> @@ -71,14 +54,14 @@ DEINSTALL)
> =C2=A0=C2=A0=C2=A0 ${PKG_PREFIX}/etc/mke2fs.conf.dist
> =C2=A0 then
> =C2=A0=C2=A0=C2=A0 rm -f ${PKG_PREFIX}/etc/mke2fs.conf
> - else
> + elif [ "_${PKG_UPGRADE-upgrade}" =3D _upgrade ] ; then
> =C2=A0=C2=A0=C2=A0 echo "If and only if you are deleting e2fsprogs foreve=
r,"
> =C2=A0=C2=A0=C2=A0 echo "remember to delete ${PKG_PREFIX}/etc/mke2fs.conf=
."
> =C2=A0 fi
> =C2=A0 # e2fsck.conf is no longer part of the distribution, but still sup=
ported,
> =C2=A0 # =3D> no pkg-list @sample line possible
> =C2=A0 #=C2=A0=C2=A0=C2=A0 and no reference e2fsck.conf.sample or e2fsck.=
conf.dist is available
> - if test -f ${PKG_PREFIX}/etc/e2fsck.conf
> + if test -f ${PKG_PREFIX}/etc/e2fsck.conf -a "_${PKG_UPGRADE-upgrade}" =
=3D _upgrade
> =C2=A0 then
> =C2=A0=C2=A0=C2=A0 echo "If and only if you are deleting e2fsprogs foreve=
r,"
> =C2=A0=C2=A0=C2=A0 echo "remember to delete ${PKG_PREFIX}/etc/e2fsck.conf=
."
> diff --git a/sysutils/e2fsprogs/pkg-plist b/sysutils/e2fsprogs/pkg-plist
> index b479a627310b..83a2baf4e486 100644
> --- a/sysutils/e2fsprogs/pkg-plist
> +++ b/sysutils/e2fsprogs/pkg-plist
> @@ -1,5 +1,5 @@
> -/sbin/e2fsck
> -/sbin/fsck_ext2fs
> +%%ROOTSBIN%%/sbin/e2fsck
> +%%ROOTSBIN%%/sbin/fsck_ext2fs
> bin/chattr
> bin/e2fsprogs-compile_et
> %%FUSEFS%%bin/fuse2fs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?93738b88-4f35-4e56-b220-25026f9cd62f>