From owner-svn-ports-head@freebsd.org Wed Sep 23 12:44:18 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D4FE3F88C8; Wed, 23 Sep 2020 12:44:18 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxHtV1hWSz4n6y; Wed, 23 Sep 2020 12:44:18 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E4BA104D2; Wed, 23 Sep 2020 12:44:18 +0000 (UTC) (envelope-from mandree@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08NCiHjs090696; Wed, 23 Sep 2020 12:44:17 GMT (envelope-from mandree@FreeBSD.org) Received: (from mandree@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08NCiHUQ090692; Wed, 23 Sep 2020 12:44:17 GMT (envelope-from mandree@FreeBSD.org) Message-Id: <202009231244.08NCiHUQ090692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mandree set sender to mandree@FreeBSD.org using -f From: Matthias Andree Date: Wed, 23 Sep 2020 12:44:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r549723 - head/sysutils/e2fsprogs X-SVN-Group: ports-head X-SVN-Commit-Author: mandree X-SVN-Commit-Paths: head/sysutils/e2fsprogs X-SVN-Commit-Revision: 549723 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 12:44:18 -0000 Author: mandree Date: Wed Sep 23 12:44:16 2020 New Revision: 549723 URL: https://svnweb.freebsd.org/changeset/ports/549723 Log: - make /sbin/e2fsck and /sbin/fsck_ext2fs visible in pkg catalog/"pkg which", so that "pkg which /sbin/e2fsck" yields the proper result. * this entails symlinking from $PREFIX/sbin to /sbin, and the pkg-install script will attempt to replace the symlinks by hard links if possible. pkg 1.15.4 cannot deal with packaged hard links and will fail. * Note that it is unavoidable that these be in /sbin because /usr/local or /usr may not be mounted and consequently ext2 file systems could not be fsck-ed or mounted from /etc/fstab. There will be no port option to avoid /sbin installs for now. We have too many options already and the testing effort increases exponentially. - make sure pkg-message appears on both install and upgrade - clean up and document/comment pkg-install so that armchair experts will not pester me with meaningless change requests - bugfix/change: logic of mke2fs.conf upgrade handling to present less work for users on port/package upgrades - bump PORTREVISION PR: 249284 (related) Modified: head/sysutils/e2fsprogs/Makefile head/sysutils/e2fsprogs/pkg-install head/sysutils/e2fsprogs/pkg-message head/sysutils/e2fsprogs/pkg-plist Modified: head/sysutils/e2fsprogs/Makefile ============================================================================== --- head/sysutils/e2fsprogs/Makefile Wed Sep 23 12:31:14 2020 (r549722) +++ head/sysutils/e2fsprogs/Makefile Wed Sep 23 12:44:16 2020 (r549723) @@ -3,7 +3,7 @@ PORTNAME= e2fsprogs PORTVERSION= 1.45.6 -PORTREVISION?= 3 +PORTREVISION?= 4 CATEGORIES?= sysutils MASTER_SITES= KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION} @@ -252,7 +252,8 @@ post-build: && ${MAKE_CMD} e2fsck V=1 \ LIBS="-static-libgcc -lc -Bstatic ../lib/libsupport.a ../lib/libext2fs.a ../lib/libcom_err.a \ ${_staticlibs} /usr/lib/libexecinfo.a /usr/lib/libelf.a \ - ${LOCALBASE}/lib/libblkid.a ${LOCALBASE}/lib/libuuid.a ${libintl} ../lib/libe2p.a " + ${LOCALBASE}/lib/libblkid.a ${LOCALBASE}/lib/libuuid.a ${libintl} ../lib/libe2p.a " \ + && ${STRIP_CMD} e2fsck # Regression check: avoid a port (not upstream!) regression from 1.40.5, # check that e2fsck isn't dynalinked against anything but libc.so: @${ECHO_CMD} -n "===> checking that e2fsck depends on no shared objects outside /lib: " @@ -292,7 +293,24 @@ post-build: .endif post-install: - ${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/ + # pkg workaround time again; + # the whole purpose of this dance is to move the necessities for + # /etc/fstab fsck'ing into /sbin, and symlink to these guys + # in the regular hierarchy, normally $PREFIX/sbin. Hard links may + # crash the install if /usr[/local] is a separate file system from /, + # and pkg 1.15.4 can't automatically unroll or install relative symlinks. + ${MKDIR} ${STAGEDIR}/sbin + ${MV} -f ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}/sbin/ # from INSTALL_TARGET + ${INSTALL_PROGRAM} ${WRKSRC}/fsck_ext2fs ${STAGEDIR}/sbin/ # from port + # according to TPH 6.1.1 Handling Symbolic Links, these are to be absolute, + # yet stage-qa warns about these on 2020-09-16: + ${LN} -fs /sbin/fsck_ext2fs ${STAGEDIR}${PREFIX}/sbin/ + ${LN} -fs /sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/ + # these are made hardlinks to symlinks - -P avoids following them to /sbin: + ${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext2 + ${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext3 + ${LN} -fP ${STAGEDIR}${PREFIX}/sbin/e2fsck ${STAGEDIR}${PREFIX}/sbin/fsck.ext4 + # now the remainder of the usual post-install jobs: ${INSTALL_MAN} ${FILESDIR}/fsck_ext2fs.8 ${STAGEDIR}${PREFIX}/man/man8/ .if ${PORT_OPTIONS:MDOCS} ${MKDIR} ${STAGEDIR}${DOCSDIR} @@ -300,7 +318,7 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} .endfor .endif -# remove or relocate files installed by other ports already, or shadowing system files: + # remove or relocate files installed by other ports already, or shadowing system files: cd ${STAGEDIR}${PREFIX} && \ ${XARGS} <${FILESDIR}/unwanted ${RM} && \ ${RMDIR} include/e2fsprogs/blkid include/e2fsprogs/ss share/ss Modified: head/sysutils/e2fsprogs/pkg-install ============================================================================== --- head/sysutils/e2fsprogs/pkg-install Wed Sep 23 12:31:14 2020 (r549722) +++ head/sysutils/e2fsprogs/pkg-install Wed Sep 23 12:44:16 2020 (r549723) @@ -1,41 +1,44 @@ #!/bin/sh -set -e +set -eu PKGNAME="$1" MODE="$2" # PRE-INSTALL, POST-INSTALL, DEINSTALL, POST-DEINSTALL case "$MODE" in POST-INSTALL) - # install fsck tool and wrapper. - err=0 - for i in e2fsck fsck_ext2fs ; do - ln -f ${PKG_PREFIX}/sbin/${i} /sbin 2>/dev/null \ - || cp -p ${PKG_PREFIX}/sbin/${i} /sbin \ - || err=1 - done - if test $err = 1 ; then - echo '========================================================================' - echo 'Warning: cannot install fsck to /sbin!' - echo 'Requesting ext2fs to be checked from /etc/fstab can cause boot failures!' - echo '========================================================================' - echo '' + # try to replace the e2fsck and its wrapper, fsck_ext2fs, + # symbolic links by hard links if possible (pkg ships them as symlinks) + d1=${PKG_ROOTDIR}/sbin/ ; dev1=$(stat -Lf %Xd "$d1") + d2=${PKG_ROOTDIR}${PKG_PREFIX}/sbin/ ; dev2=$(stat -Lf %Xd "$d2") + if [ "$dev1" = "$dev2" ] && [ "$(realpath "$d1")" != "$(realpath "$d2")"; then + for i in e2fsck fsck_ext2fs ; do + ln -fhP ${d1}${i} ${d2}${i} + done + for i in ext2 ext3 ext4 ; do + ln -fhP ${d2}e2fsck ${d2}fsck.$i + done fi # - # install configuration file and update + # install configuration file and update config files from + # old "ext4dev" to current "ext4" name. # - if test -f ${PKG_PREFIX}/etc/mke2fs.conf; then + if test -s ${PKG_PREFIX}/etc/mke2fs.conf; then if cmp -s ${PKG_PREFIX}/etc/mke2fs.conf.dist \ - ${PKG_PREFIX}/etc/mke2fs.conf; then + ${PKG_PREFIX}/etc/mke2fs.conf; then true else - if grep -q ext4dev ${PKG_PREFIX}/etc/mke2fs.conf ; then + rc=0 + grep -q ext4dev ${PKG_PREFIX}/etc/mke2fs.conf || rc=$? + case $rc in + 1) # ext4dev not found (old name) cp -f -p ${PKG_PREFIX}/etc/mke2fs.conf.dist \ ${PKG_PREFIX}/etc/mke2fs.conf.e2fsprogs-new echo "===========================================================================" echo "Warning: installing mke2fs.conf in ${PKG_PREFIX}/etc/mke2fs.conf.e2fsprogs-new" echo "Check to see if you need to update your ${PKG_PREFIX}/etc/mke2fs.conf" echo "===========================================================================" - else + ;; + 0) # ext4dev found (old name) mv ${PKG_PREFIX}/etc/mke2fs.conf \ ${PKG_PREFIX}/etc/mke2fs.conf.e2fsprogs-old cp -f -p ${PKG_PREFIX}/etc/mke2fs.conf.dist \ @@ -45,17 +48,19 @@ POST-INSTALL) echo "${PKG_PREFIX}/etc/mke2fs.conf.e2fsprogs-old. Please check to see" echo "if you have any local customizations that you wish to preserve." echo "===========================================================================" - fi - echo " " + ;; + *) # grep failed + exit $rc + ;; + esac fi else - cp -f -p ${PKG_PREFIX}/etc/mke2fs.conf.dist \ + # missing -> install + cp -p ${PKG_PREFIX}/etc/mke2fs.conf.dist \ ${PKG_PREFIX}/etc/mke2fs.conf fi ;; DEINSTALL) - rm -f /sbin/fsck_ext2fs /sbin/e2fsck \ - || echo "Could not remove /sbin/fsck_ext2fs /sbin/e2fsck. Please remove manually." if cmp -s ${PKG_PREFIX}/etc/mke2fs.conf \ ${PKG_PREFIX}/etc/mke2fs.conf.dist then @@ -64,13 +69,13 @@ DEINSTALL) echo "If and only if you are deleting e2fsprogs forever," echo "remember to delete ${PKG_PREFIX}/etc/mke2fs.conf." fi + # e2fsck.conf is no longer part of the distribution, but still supported, + # => no pkg-list @sample line possible + # and no reference e2fsck.conf.sample or e2fsck.conf.dist is available if test -f ${PKG_PREFIX}/etc/e2fsck.conf then echo "If and only if you are deleting e2fsprogs forever," echo "remember to delete ${PKG_PREFIX}/etc/e2fsck.conf." fi - ;; -PRE-INSTALL|POST-DEINSTALL) - true ;; esac Modified: head/sysutils/e2fsprogs/pkg-message ============================================================================== --- head/sysutils/e2fsprogs/pkg-message Wed Sep 23 12:31:14 2020 (r549722) +++ head/sysutils/e2fsprogs/pkg-message Wed Sep 23 12:44:16 2020 (r549723) @@ -1,3 +1,8 @@ +[ +{ message: <