Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
chroot testing of binary installers [solved with ebuilds]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Wed May 02, 2007 10:15 pm    Post subject: chroot testing of binary installers [solved with ebuilds] Reply with quote

I like to install a couple of non ebuild packages, a new driver for my printer and APC's powerchute software for linux. The first is a source build and the second is a binary install.

Is it possible to create a directory, eg /opt/testinstall, chroot into that directory and then "install" the programs using that directory as root to see what files is would create and install?

Can anyone give me a sample step by step?

Thanks
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham


Last edited by gnac on Thu May 03, 2007 3:17 am; edited 1 time in total
Back to top
View user's profile Send private message
CoolBeer
Tux's lil' helper
Tux's lil' helper


Joined: 14 Nov 2003
Posts: 76
Location: Alta, Norway

PostPosted: Wed May 02, 2007 10:29 pm    Post subject: Reply with quote

What I would do in this case is to write a custom ebuild and put it in an overlay, it's what I do with software I write myself.
I find this the easiest way cause portage takes care of the filelist, upgrading, uninstalling and all that.

But if you don't want to go that way with it, you could, atleast for the source package, and providing it has a configure script, pass --prefix /opt/testinstall to install it to another location just to see what files it creates.
What you would do with the binary is really dependent on the binary install I guess.

Hope this helps, and good luck :)
Back to top
View user's profile Send private message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Wed May 02, 2007 10:40 pm    Post subject: Reply with quote

Quote:
What I would do in this case is to write a custom ebuild and put it in an overlay, it's what I do with software I write myself.
I find this the easiest way cause portage takes care of the filelist, upgrading, uninstalling and all that.


So I thought about that. Have never done it before, but I really want to make sure that any install I do does not overwrite existing files, or add non compatible libraries etc. I ran into this very same problem with a proprietary samsung printer driver and if it wasn't for my daily backups, I would have never been able to figure out what the heck it did. It ended up adding a non compatible libstc in addition to changing the permissions on several key files that really screwed things up.

Does portage/overlay ebuild provide file protection of any sort?


Thanks
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Back to top
View user's profile Send private message
buddabrod
Apprentice
Apprentice


Joined: 15 Oct 2006
Posts: 241
Location: Germany

PostPosted: Thu May 03, 2007 12:34 am    Post subject: Reply with quote

You have to set collision-protect in portage features, that's what you want ;)
Back to top
View user's profile Send private message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Thu May 03, 2007 3:16 am    Post subject: Reply with quote

buddabrod wrote:
You have to set collision-protect in portage features, that's what you want ;)


Sweet, thats the ticket. The whole chroot thing ended up being a freakin mess what with all the dependencies needed to be brought into the chroot environment and all.
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Back to top
View user's profile Send private message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Thu May 03, 2007 3:29 am    Post subject: Reply with quote

FWIW, to create a chroot environment you need to create a directory, call it chrootJail, populate it with the root filesystem layout, (chrootJail/var, chrootJail/bin, chrootJail/usr/bin, chrootJail/lib at a minimum) and then copy all of the programs you want to use into the respective directories:

Code:
cp /bin/bash chrootJail/bin


And then you need to use ldd to find all of the libraries that program needs and then copy those into their respective lib directory
Code:
ldd /bin/bash


Then you can chroot into that directory using a command you copied into it, usually bash:
Code:
chroot chrootJail /bin/bash

You will only have the functionality of programs you explicitly copied into your chrootJail. Coping programs and their dependencies can get quickly tiresome, so you could just copy the entire contents of /bin and /lib, and maybe /usr/bin and /usr/lib if you want to get really nuts, but then it becomes hard to determine what files were overwritten by the installer, but perhaps not quite as hard as doing it on your working system.
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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