Advanced Portage tricks help

Anything that pertains to Portage

Moderator: Moderators

Advanced Portage tricks help

Postby chickpea » Tue Oct 07, 2008 15:12

So ok, I have been struggling with getting my system backup and running after screwing up that e2fsprogs upgrade (yeah I know well documented and all that).

Suffice it to say, I have learned now that prior to world upgrades I am now going to prefetch world. The issue all revolves around networkmanger and its damn memory leaks. When compiling 700+ packages, by the second day, portage can no longer allocate memory to itself as networkmanager has eaten it all. So normally, I would /etc/iniit.d/hald restart (but in the middle of a world rebuild this generally borks the network connection).

Now I am in a real pickle. My issue/question is really this: when I boot up the livecd, I chroot into my system fine, but when I try to do any of the following I run into a failed fetch: emerge -uND world, or emerge -uNDf world or update -f world or revdep-rebuild (which says couldn't find some temporary directory)

I know that on my HDD system, the network scripts are totally screwed and badly in need to run a revdep-rebuild. the only issue is that I do not have many (if any) of the necessary packages locally.

So what I need to figure out how to do is from the livecd side, have emerge fetch the packages but instead of downloading them to /usr/portage/distfiles, download them to /mnt/gentoo/usr/portage/distfiles

Once there, I can easily run a revdep-rebuild in my system without the livecd (I am able to login normally to my system, just networkmanager/net-setup does not work).

Any insight greatly appreciated.
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: Advanced Portage tricks help

Postby chickpea » Tue Oct 07, 2008 15:30

Another thing, before someone mentions it, it seems like it is close to a solution but needs refinement:

Code: Select all
mount --bind -o /usr/portage/distfiles /mnt/gentoo/usr/portage/distfiles


is how to get the current root to use /mnt/gentoo/usr/portage/distfiles as the dir to download the distfiles into, but I need also to have the emerge world from the /dev/sda5 system to calculate world. That's the real trick for me is how to do that. Ideas?

Code: Select all
mount --bind /var/libs/portage/world /mnt/gentoo/var/libs/portage/world


would something like this work?
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: Advanced Portage tricks help

Postby chickpea » Tue Oct 07, 2008 16:19

hmm, maybe this is what I need to do

First:
Code: Select all
mount --bind /usr/portage/distfiles/ /mnt/gentoo/usr/portage/distfiles


That dumps anything that would have been put in my local /usr/portage/distfiles directory into the same directory in the chroot jail

Then:

Code: Select all
mount --bind /mnt/gentoo/var/libs/portage /var/libs/portage


this will force emerge to think that my chrooted world is actual world. So I can then calculate world update, fetch and those packages will be fetched to the chroot jail. Looks good no?
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: Advanced Portage tricks help

Postby WarraWarra » Tue Oct 07, 2008 16:25

If you download them to another folder and symlink like mentioned above or download them to correct normal folder in chroot it is the same as it will be there once you reboot.
chroot is just a cheat to have working everything instead of defective busted boot from hd.

emerge --fetchonly system


Remember you can update and so have busted problems still being busted or cheat by re / fresh installing new files for say system or world.
Busted = broken deps / corrupted files.

example:
emerge system

versus
emerge --update system


1st = clean install of new version replacing any busted files / deps etc you get the idea. This does not replace user gen config files outside of default install.
2nd = busted stayes but runs with newer installed version of say kde or ndiswrtapper and problems remain. Very bad patch and solution option. :oops:

Try to first and only do a system update / reisntall with newer version files like above.
Then reboot and test = system works well = stable of sorts then do world update after making system backup.

New install proper way:
Theoretically you should boot using live cd and format hd then build to new file specs from live cd to hd to have a proper updated system / world same as with old school gentoo installs after setting custom make.conf and performance settings.
This just takes lost of time unless you can do it with equo instead of emerge but have not tried equo like this yet.
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Re: Advanced Portage tricks help

Postby chickpea » Tue Oct 07, 2008 16:53

Thanks warra, yeah I realize that updating alone won't fix anything, but revdep-rebuild should :P

The trickiest part is just getting the livecd emerge environment to look to the chroot to calculate world, so I get all the packages down (also I probably don't have enough RAM to store all those packages 500+ unless I write them to the chroot).

That's the tricky part for me is getting emerge to look at the chroot to calculate world, the rest I can deal with on my own.
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: Advanced Portage tricks help

Postby WarraWarra » Tue Oct 07, 2008 17:36

Memory:
If exiting gui in live cd then networkmanager should not cause any issues so do a nox cheat code boot and root login.

It should in chroot look at the default as if there is no live cd enviroment and will download the files to default folder /etc/portage....
Just run
Code: Select all
emerge --sync ; emerge portage ; emerge --fetchonly --deep system ; emerge system ; revdep-rebuild -X


This replaces whole portage tree , updates portage , download "deep dependancy check" the system , install system to current latest version , then rebuild deps
Go make some coffee and walk the dog and then see what happened.

it might fail on emerge system or revdep-rebuild.

the ; seperates commands so until the one before it finishes or fails it will not continue and if fail all stops so might add some
--skipfirst --resume --skipfirst
after emerge system.

Actually it can not kill the network if in chroot if I remember correctly as the hd installed does not have anything loaded for networking "blow-up doll" so you are like god putting food in the fridge "installed hd" and the guest "livecd" controls the networking and passes it onto liveless hd install.

So might just sync , update portage and then revdep-...
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Re: Advanced Portage tricks help

Postby chickpea » Tue Oct 07, 2008 19:01

It should in chroot look at the default as if there is no live cd enviroment and will download the files to default folder /etc/portage...


right except wget is not working in my chroot jail. So I can't just chroot in and pull down the distfiles, hence this elaborate setup. I need to use the livecd utiils and the HDD as merely a mounted dir.
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: Advanced Portage tricks help

Postby chickpea » Wed Oct 08, 2008 16:59

In the end, it was simply a matter of copying over my resolv.conf from the livecd environment to the chroot that got wget up and running.

One problem that I am now facing in my chroot, is that for whatever reason emerge -uND --fetchonly world fails to resolve dependencies ARGH! Not even the trusty update can save me. So I am hoping that I can just fetch the packages to do a revdep-rebuild once back in my system.

Now it's an issue where I have started to fetch all the packages, but I have run into fetch restricted packages. So fetch stops about 1/3 of the way through. Emerge --resume --skipfirst doesn't work on an emerge --fetchonly world. So I am kind of stuck. I am thinking of doing something like:
Code: Select all
#eix --find me all the packages without fetch restrictions > /home/$USER/Desktop/emergeme.txt

then

#xargs -some option emerge --fetchonly > /home/$USER/Desktop/emergeme.txt


What say you folks this possible/stupid/needlessly complex?
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC


Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 1 guest

cron