Debian Bug report logs - #324162
lvm2create_initrd.gz does not filter linux-gate.so.1 when calculating library dependencies

version graph

Package: lvm2; Maintainer for lvm2 is Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>; Source for lvm2 is src:lvm2.

Reported by: Michael Stilkerich <michael.stilkerich@stud.informatik.uni-erlangen.de>

Date: Sat, 20 Aug 2005 16:03:03 UTC

Severity: minor

Found in version lvm2/2.01.14-1

Done: Bastian Blank <waldi@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#324162; Package lvm2. Full text and rfc822 format available.

Acknowledgement sent to Michael Stilkerich <michael.stilkerich@stud.informatik.uni-erlangen.de>:
New Bug report received and forwarded. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Michael Stilkerich <michael.stilkerich@stud.informatik.uni-erlangen.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: lvm2create_initrd.gz does not filter linux-gate.so.1 when calculating library dependencies
Date: Sat, 20 Aug 2005 17:57:48 +0200
Package: lvm2
Version: 2.01.14-1
Severity: minor

Linux 2.6 includes some kind of gateway between user and kernel space. This is
realized via a ghost library linux-gate.so.1.

lvm2create_initrd.gz calls ldd to determine the required libraries.
The ldd result includes linux-gate.so.1 in the form
linux-gate.so.1 =>  (0xffffe000)
which breaks the following awk expression and makes the created initrd useless.

Please fix this issue, e.g. by adding grep -v 'linux-gate.so.1' to the pipe
between ldd and awk.

Note that linux-gate might be called different on other architectures. See
http://www.uwsg.iu.edu/hypermail/linux/kernel/0306.2/0674.html
for more information on this topic.

-Mike

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.3
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages lvm2 depends on:
ii  debconf                      1.4.57      Debian configuration management sy
ii  libc6                        2.3.5-4     GNU C Library: Shared libraries an
ii  libdevmapper1.01             2:1.01.04-2 The Linux Kernel Device Mapper use
ii  libselinux1                  1.24-4      SELinux shared libraries
ii  lvm-common                   1.5.20      The Logical Volume Manager for Lin

lvm2 recommends no packages.

-- debconf information excluded



Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#324162; Package lvm2. Full text and rfc822 format available.

Acknowledgement sent to Thomas Venieris <mot@mediaweb.gr>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #10 received at 324162@bugs.debian.org (full text, mbox):

From: Thomas Venieris <mot@mediaweb.gr>
To: 324162@bugs.debian.org
Subject: Re: lvm2create_initrd.gz does not filter linux-gate.so.1 when calculating library dependencies
Date: Mon, 13 Feb 2006 03:41:46 +0200
The LIBFILES=`ldd .....` line in lvm2create_initrd is an accident
waiting to happen.

Apart from not filtering linux-gate.so.1, it also _filters_ needed
libraries:

mot@bones:~$ ldd /bin/bash
        linux-gate.so.1 =>  (0xffffe000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb7ecb000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0xb7ec7000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb7d90000)
        /lib/ld-linux.so.2 (0xb7f26000)     #  <------ This line is filtered

...because it does not contain a '=>'. That library is named differently
on x86-64 systems btw.

So the best way I found to make the script work is this:

# Make sure NOT to include linux-gate.so.1 which is virtual (does not
really exist)
LIBFILES=`ldd $BINFILES 2>/dev/null | grep -v "linux-gate.so.1 =>" | awk
'{if (/=>/) { print $3 }}' | sort -u`

# Make sure to INCLUDE the ld-linux.so lib (does not have a '=>')
LD_SO_FILE=`ldd $BINFILES | grep -v " => " | grep "/ld-linux" | awk '{
print $1 }' | sort -u`
LIBFILES="$LIBFILES $LD_SO_FILE"


Yes, its ugly as hell but thats the best I could do. Feel free to make
it better :-)


Finally, when the script creates the directories on the initrd
filesystem, it should be nice if it created the link from /lib64 to /lib
for x86-64 systems:

verbose "creating basic set of directories in $TMPMNT"
(cd $TMPMNT; mkdir bin dev etc lib proc sbin var; ln -s lib lib64)

Hope those help. Best regards!

-- 
moT

"There's the television. It's all right there. It's all
right there. Look. Listen. Kneel. Pray. Commercials."
                                           (12 Monkeys)




Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#324162; Package lvm2. Full text and rfc822 format available.

Acknowledgement sent to Stuart Freeman <stuartf@uga.edu>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #15 received at 324162@bugs.debian.org (full text, mbox):

From: Stuart Freeman <stuartf@uga.edu>
To: 324162@bugs.debian.org
Subject: This bothered me too, patch included that does better filtering
Date: Wed, 15 Feb 2006 14:38:00 -0500
Here's how I addressed this issue:

--- lvm2create_initrd	2006-02-15 14:30:28.000000000 -0500
+++ src/lvm2create_initrd	2006-02-15 14:31:31.000000000 -0500
@@ -269,7 +269,7 @@
 # Figure out which shared libraries we actually need in our initrd
 echo "$cmd -- finding required shared libraries"
 verbose "BINFILES: `echo $BINFILES`"
-LIBFILES=`ldd $BINFILES 2>/dev/null | awk '{if (/=>/) { print $3 }}' | sort -u`
+LIBFILES=`ldd $BINFILES 2>/dev/null | awk '{if (/=>/ && NF == 4) { print $3 } else {print $1}}'| grep -v 'linux-gate\.so' | sort -u`
 if [ $? -ne 0 ]; then
    echo "$cmd -- ERROR figuring out needed shared libraries"
    exit 1

-- 
----------------------------------------------
D. Stuart Freeman
UGA Enterprise Information Technology Services
Core Services Support
-
Unix is a Registered Bell of AT&T Trademark Laboratories.
		-- Donn Seeley
----------------------------------------------



Information forwarded to debian-bugs-dist@lists.debian.org, Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>:
Bug#324162; Package lvm2. Full text and rfc822 format available.

Acknowledgement sent to Alasdair G Kergon <agk@redhat.com>:
Extra info received and forwarded to list. Copy sent to Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #20 received at 324162@bugs.debian.org (full text, mbox):

From: Alasdair G Kergon <agk@redhat.com>
To: Thomas Venieris <mot@mediaweb.gr>, 324162@bugs.debian.org
Subject: Re: Bug#324162: lvm2create_initrd.gz does not filter linux-gate.so.1 when calculating library dependencies
Date: Tue, 21 Nov 2006 22:49:41 +0000
Reported on linux-lvm recently by a gentoo user, and the script updated
for lvm2 2.02.16.

Please test:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/LVM2/scripts/lvm2create_initrd/lvm2create_initrd?rev=1.2&content-type=text/plain&cvsroot=lvm2
and if you find problems, submit patches against this new version to
the lvm-devel@redhat.com list.

Alasdair
-- 
agk@redhat.com



Reply sent to Bastian Blank <waldi@debian.org>:
You have taken responsibility. (Fri, 21 Nov 2008 19:36:03 GMT) Full text and rfc822 format available.

Notification sent to Michael Stilkerich <michael.stilkerich@stud.informatik.uni-erlangen.de>:
Bug acknowledged by developer. (Fri, 21 Nov 2008 19:36:04 GMT) Full text and rfc822 format available.

Message #25 received at 324162-done@bugs.debian.org (full text, mbox):

From: Bastian Blank <waldi@debian.org>
To: 324162-done@bugs.debian.org
Subject: not longer shiped
Date: Fri, 21 Nov 2008 20:35:20 +0100
The script is not longer included in the package. Use initramfs-tools.

Bastian

-- 
Beam me up, Scotty!




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 20 Dec 2008 07:29:58 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 15:46:24 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.