Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Statically compile vgchange
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
deltamalloc
Apprentice
Apprentice


Joined: 18 Jan 2013
Posts: 279

PostPosted: Tue Jul 02, 2013 2:39 pm    Post subject: Statically compile vgchange Reply with quote

I need to include vgchange in my initrd in order to boot an encrypted root partition.

My question is simple: How do I compile just the vgchange binary statically linked?

Edit: I should mention that I already have the binary compiled, but dynamically linked. How can I recompile it statically linked?
Back to top
View user's profile Send private message
deltamalloc
Apprentice
Apprentice


Joined: 18 Jan 2013
Posts: 279

PostPosted: Tue Jul 02, 2013 2:57 pm    Post subject: Reply with quote

I tried to add the static keyword to my USE variable. I then did

Code:

emerge sys-fs/lvm2


However this failed with the following error:

Code:

...
(.text.util_lookup_user+0xde): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(util.o): In function `lookup_uid':
(.text.lookup_uid+0xab): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(time-util.o): In function `now':
(.text.now+0x8): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[1]: *** [dmsetup.static] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/work/LVM2.2.02.97/tools'
make: *** [tools.device-mapper] Error 2
 * ERROR: sys-fs/lvm2-2.02.97-r1 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-fs/lvm2-2.02.97-r1'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/lvm2-2.02.97-r1'`.
 * The complete build log is located at '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/work/LVM2.2.02.97'
 * S: '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/work/LVM2.2.02.97'

>>> Failed to emerge sys-fs/lvm2-2.02.97-r1, Log file:

>>>  '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/temp/build.log'

 * Messages for package sys-fs/lvm2-2.02.97-r1:

 * Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with
 * their static versions. If you need the static binaries,
 * you must append .static to the filename!
 * ERROR: sys-fs/lvm2-2.02.97-r1 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-fs/lvm2-2.02.97-r1'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/lvm2-2.02.97-r1'`.
 * The complete build log is located at '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/work/LVM2.2.02.97'
 * S: '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/work/LVM2.2.02.97'
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Tue Jul 02, 2013 8:36 pm    Post subject: Reply with quote

A) do not use static system wide. It does weird things. Put in in package.use You may need to create the file.
B) try adding static-libs and remove the udev flag. There is somthing funny happening with LVM and udev.

You should put the following in /etc/portage/package.use
Code:
sys-fs/lvm2  static static-libs -udev
You will need to add several other packages with static. Portage will tell you which ones.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
deltamalloc
Apprentice
Apprentice


Joined: 18 Jan 2013
Posts: 279

PostPosted: Tue Jul 02, 2013 10:32 pm    Post subject: Reply with quote

The Doctor wrote:
A) do not use static system wide. It does weird things. Put in in package.use You may need to create the file.
B) try adding static-libs and remove the udev flag. There is somthing funny happening with LVM and udev.

You should put the following in /etc/portage/package.use
Code:
sys-fs/lvm2  static static-libs -udev
You will need to add several other packages with static. Portage will tell you which ones.


Thanks, that worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum