* Re: Bug#924275: Pulls in lvm2 packages on systems not needing them [not found] <155224974445.827475.8622512417054538613.reportbug@ds9.feds.ath.cx> @ 2019-03-11 0:22 ` Theodore Ts'o 2019-03-12 2:33 ` Darrick J. Wong 0 siblings, 1 reply; 2+ messages in thread From: Theodore Ts'o @ 2019-03-11 0:22 UTC (permalink / raw) To: Sven Hartge, 924275; +Cc: linux-ext4, darrick.wong, control [-- Attachment #1: Type: text/plain, Size: 629 bytes --] tag 924275 +pending thanks On Sun, Mar 10, 2019 at 09:29:04PM +0100, Sven Hartge wrote: > > While I like the new fsck-via-LVM-snapshot feature, I think adding lvm2 > to Recommends is too agressive here. > > On systems not using LVM this will needlessly pull in the whole LVM/DM > machinery, including changes to the initramfs, as long as apt is in its > default "install-recommends" configuration. > > Only on systems where the system admin has changed the default to > "no-install-recommends" nothing will happen. Agreed; thanks for pointing this out! I have the following patches queued for the next release. - Ted [-- Attachment #2: 0001-e2scrub-check-to-make-sure-lvm2-is-installed.patch --] [-- Type: text/x-diff, Size: 2667 bytes --] From 04738f2ff3b8a2acaf2de09856e07601817350b5 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o <tytso@mit.edu> Date: Sun, 10 Mar 2019 19:41:11 -0400 Subject: [PATCH 1/2] e2scrub: check to make sure lvm2 is installed Not all systems will have the lvm2 package installed, so check for that. Pretty much all systems should have util-linux installed, but check for that as well. Of course, if lvm2 is installed we shouldn't find any LVM devices --- but eventually the Demon Murphy will find a way to make it happen. :-) Also, set the PATH so we don't have to worry about the script failing due to /sbin not being in the path. Signed-off-by: Theodore Ts'o <tytso@mit.edu> --- scrub/e2scrub.in | 12 ++++++++++++ scrub/e2scrub_all.in | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in index e1965db4e..51a909373 100644 --- a/scrub/e2scrub.in +++ b/scrub/e2scrub.in @@ -23,6 +23,8 @@ # check filesystems in VGs that have at least 256MB (or so) of # free space. +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + snap_size_mb=256 fstrim=0 reap=0 @@ -82,6 +84,16 @@ if [ -z "${arg}" ]; then exitcode 1 fi +if ! type lsblk >& /dev/null ; then + echo "e2scrub: can't find lsblk --- is util-linux installed?" + exitcode 1 +fi + +if ! type lvcreate >& /dev/null ; then + echo "e2scrub: can't find lvcreate --- is lvm2 installed?" + exitcode 1 +fi + # Find the device for a given mountpoint dev_from_mount() { local mountpt="$(realpath "$1")" diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in index 23d122d25..d725a7f2e 100644 --- a/scrub/e2scrub_all.in +++ b/scrub/e2scrub_all.in @@ -18,6 +18,8 @@ # along with this program; if not, write the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + scrub_all=0 conffile="@root_sysconfdir@/e2scrub.conf" @@ -68,6 +70,20 @@ while getopts "ArV" opt; do done shift "$((OPTIND - 1))" +# If some prerequisite packages are not installed, exit with a code +# indicating success to avoid spamming the sysadmin with fail messages +# when e2scrub_all is run out of cron or a systemd timer. + +if ! type lsblk >& /dev/null ; then + echo "e2scrub_all: can't find lsblk --- is util-linux installed?" + exitcode 0 +fi + +if ! type lvcreate >& /dev/null ; then + echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?" + exitcode 0 +fi + # Find scrub targets, make sure we only do this once. ls_scrub_targets() { lsblk -o NAME,FSTYPE,MOUNTPOINT -p -P -n | while read vars; do -- 2.19.1 [-- Attachment #3: 0002-debian-drop-lvm2-from-the-recommends-line.patch --] [-- Type: text/x-diff, Size: 1028 bytes --] From 212ba2a8a81001bce21cce314f9bc2967f2df7c7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o <tytso@mit.edu> Date: Sun, 10 Mar 2019 20:01:58 -0400 Subject: [PATCH 2/2] debian: drop lvm2 from the recommends line If the user doesn't intend to use lvm2, and it's not installed, installing e2fsprogs shouldn't drag it (and all of its dependencies) into the system. Addresses-Debian-Bug: 924275 Signed-off-by: Theodore Ts'o <tytso@mit.edu> --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 1bb8adb15..e454687f9 100644 --- a/debian/control +++ b/debian/control @@ -191,7 +191,7 @@ XB-Important: yes Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, libblkid1, libuuid1 Multi-Arch: foreign Suggests: gpart, parted, fuse2fs, e2fsck-static -Recommends: e2fsprogs-l10n, lvm2 +Recommends: e2fsprogs-l10n Architecture: any Description: ext2/ext3/ext4 file system utilities The ext2, ext3 and ext4 file systems are successors of the original ext -- 2.19.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: Bug#924275: Pulls in lvm2 packages on systems not needing them 2019-03-11 0:22 ` Bug#924275: Pulls in lvm2 packages on systems not needing them Theodore Ts'o @ 2019-03-12 2:33 ` Darrick J. Wong 0 siblings, 0 replies; 2+ messages in thread From: Darrick J. Wong @ 2019-03-12 2:33 UTC (permalink / raw) To: Theodore Ts'o; +Cc: Sven Hartge, 924275, linux-ext4, control On Sun, Mar 10, 2019 at 08:22:08PM -0400, Theodore Ts'o wrote: > tag 924275 +pending > thanks > > On Sun, Mar 10, 2019 at 09:29:04PM +0100, Sven Hartge wrote: > > > > While I like the new fsck-via-LVM-snapshot feature, I think adding lvm2 > > to Recommends is too agressive here. > > > > On systems not using LVM this will needlessly pull in the whole LVM/DM > > machinery, including changes to the initramfs, as long as apt is in its > > default "install-recommends" configuration. > > > > Only on systems where the system admin has changed the default to > > "no-install-recommends" nothing will happen. > > Agreed; thanks for pointing this out! I have the following patches > queued for the next release. FWIW they look ok to me (who doesn't have auto-install of Recommends), so: Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> --D > - Ted > > From 04738f2ff3b8a2acaf2de09856e07601817350b5 Mon Sep 17 00:00:00 2001 > From: Theodore Ts'o <tytso@mit.edu> > Date: Sun, 10 Mar 2019 19:41:11 -0400 > Subject: [PATCH 1/2] e2scrub: check to make sure lvm2 is installed > > Not all systems will have the lvm2 package installed, so check for > that. Pretty much all systems should have util-linux installed, but > check for that as well. > > Of course, if lvm2 is installed we shouldn't find any LVM devices --- > but eventually the Demon Murphy will find a way to make it happen. :-) > > Also, set the PATH so we don't have to worry about the script failing > due to /sbin not being in the path. > > Signed-off-by: Theodore Ts'o <tytso@mit.edu> > --- > scrub/e2scrub.in | 12 ++++++++++++ > scrub/e2scrub_all.in | 16 ++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in > index e1965db4e..51a909373 100644 > --- a/scrub/e2scrub.in > +++ b/scrub/e2scrub.in > @@ -23,6 +23,8 @@ > # check filesystems in VGs that have at least 256MB (or so) of > # free space. > > +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > + > snap_size_mb=256 > fstrim=0 > reap=0 > @@ -82,6 +84,16 @@ if [ -z "${arg}" ]; then > exitcode 1 > fi > > +if ! type lsblk >& /dev/null ; then > + echo "e2scrub: can't find lsblk --- is util-linux installed?" > + exitcode 1 > +fi > + > +if ! type lvcreate >& /dev/null ; then > + echo "e2scrub: can't find lvcreate --- is lvm2 installed?" > + exitcode 1 > +fi > + > # Find the device for a given mountpoint > dev_from_mount() { > local mountpt="$(realpath "$1")" > diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in > index 23d122d25..d725a7f2e 100644 > --- a/scrub/e2scrub_all.in > +++ b/scrub/e2scrub_all.in > @@ -18,6 +18,8 @@ > # along with this program; if not, write the Free Software Foundation, > # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. > > +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin > + > scrub_all=0 > conffile="@root_sysconfdir@/e2scrub.conf" > > @@ -68,6 +70,20 @@ while getopts "ArV" opt; do > done > shift "$((OPTIND - 1))" > > +# If some prerequisite packages are not installed, exit with a code > +# indicating success to avoid spamming the sysadmin with fail messages > +# when e2scrub_all is run out of cron or a systemd timer. > + > +if ! type lsblk >& /dev/null ; then > + echo "e2scrub_all: can't find lsblk --- is util-linux installed?" > + exitcode 0 > +fi > + > +if ! type lvcreate >& /dev/null ; then > + echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?" > + exitcode 0 > +fi > + > # Find scrub targets, make sure we only do this once. > ls_scrub_targets() { > lsblk -o NAME,FSTYPE,MOUNTPOINT -p -P -n | while read vars; do > -- > 2.19.1 > > From 212ba2a8a81001bce21cce314f9bc2967f2df7c7 Mon Sep 17 00:00:00 2001 > From: Theodore Ts'o <tytso@mit.edu> > Date: Sun, 10 Mar 2019 20:01:58 -0400 > Subject: [PATCH 2/2] debian: drop lvm2 from the recommends line > > If the user doesn't intend to use lvm2, and it's not installed, > installing e2fsprogs shouldn't drag it (and all of its dependencies) > into the system. > > Addresses-Debian-Bug: 924275 > > Signed-off-by: Theodore Ts'o <tytso@mit.edu> > --- > debian/control | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/debian/control b/debian/control > index 1bb8adb15..e454687f9 100644 > --- a/debian/control > +++ b/debian/control > @@ -191,7 +191,7 @@ XB-Important: yes > Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, libblkid1, libuuid1 > Multi-Arch: foreign > Suggests: gpart, parted, fuse2fs, e2fsck-static > -Recommends: e2fsprogs-l10n, lvm2 > +Recommends: e2fsprogs-l10n > Architecture: any > Description: ext2/ext3/ext4 file system utilities > The ext2, ext3 and ext4 file systems are successors of the original ext > -- > 2.19.1 > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-12 2:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <155224974445.827475.8622512417054538613.reportbug@ds9.feds.ath.cx>
2019-03-11 0:22 ` Bug#924275: Pulls in lvm2 packages on systems not needing them Theodore Ts'o
2019-03-12 2:33 ` Darrick J. Wong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).