View previous topic :: View next topic |
Author |
Message |
jonathan183 Guru
Joined: 13 Dec 2011 Posts: 318
|
Posted: Wed Oct 09, 2013 8:42 pm Post subject: continue emerge after reboot |
|
|
There are a few packages like libreoffice which take quite a while to build on my main desktop system ... I prefer to shut the system down when I'm not using it. I have tried using emerge --resume but that appears to start rebuilding a package.
I'm after a way to be able to:
pause an emerge
shutdown the system
at some time later restart the system
and unpause the emerge at some point later.
Is there a way to do this?
I don't use suspend to disc, and run a few distros which at present use the same swap partition. |
|
Back to top |
|
|
costel78 Guru
Joined: 20 Apr 2007 Posts: 402
|
Posted: Wed Oct 09, 2013 9:04 pm Post subject: |
|
|
It might be, but only if you are trying to resume a single package, not a list of packages. And, of course, /var/tmp/portage it's not perrisable - mounted as tmpfs, for example.
The ideea is to start with emerge, forcefully stop it (Ctrl+C) and, then, resume compilation/install via ebuild EBUILD_FILE command. Something like this:
Code: | FEATURES="-fail-clean" emerge -O1 -j1 category/package
...let it to do it's job for a while... press Ctrl+C
... poweroff... start again the computer
ebuild /usr/portage/category/package/package-version.ebuild install
ebuild /usr/portage/category/package/package-version.ebuild qmerge
ebuild /usr/portage/category/package/package-version.ebuild clean
|
_________________ Sorry for my English. I'm still learning this language. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54099 Location: 56N 3W
|
Posted: Wed Oct 09, 2013 9:13 pm Post subject: |
|
|
jonathan183,
What costel78 says may work for resuming from the start of a phase within an ebuild but for large packages the longest phase is compile.
You cannot resume part way through a phase.
Any resumption part way though implies that you have saved what you did previously. That implies swap too, so you would not be able to run anything else.
This gets you to suspend to disk. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
costel78 Guru
Joined: 20 Apr 2007 Posts: 402
|
Posted: Thu Oct 10, 2013 10:56 am Post subject: |
|
|
It seems it's working to resume compile phase partially. But Makefile have to be created properly. There are packages where it start over again.
But, for libreoffice it's working to resume with ebuild ... compile and it's not starting from the begin of compile phase.
Anyway, there could be side effects of that I am not aware. _________________ Sorry for my English. I'm still learning this language. |
|
Back to top |
|
|
jonathan183 Guru
Joined: 13 Dec 2011 Posts: 318
|
Posted: Sat Oct 12, 2013 7:23 pm Post subject: |
|
|
OK thanks for the replies.
I'm going with hibernate using sys-power/hibernate-script for the moment. I ended up setting up a separate swap partition for doing this (I might play with files later). It's not quite what I wanted, because I can't suspend and resume an emerge at any time ... and I have to hibernate the entire system.
I guess suspend/resume feature for a package manager just adds complexity that's not required. |
|
Back to top |
|
|
N8Fear Tux's lil' helper
Joined: 15 Apr 2013 Posts: 140 Location: Berlin (Germany)
|
Posted: Sat Oct 12, 2013 8:08 pm Post subject: |
|
|
What definitely works is ebuild. Run:
Code: |
ebuild <package> merge
|
It'll start of, where you left it (essentially like issuing make on a partial build package when doing it manually).
It can even help with problems that are caused by nonsequential build (e.g. -j<number>). |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21497
|
Posted: Sat Oct 12, 2013 8:50 pm Post subject: |
|
|
Resuming a merge in the middle only works if the package being resumed has a build system that can handle it. Most should, but that is not a scenario that is normally tested by Gentoo users. You can pause an in-progress build by stopping the emerge process and its children. This can be resumed later and almost always works. |
|
Back to top |
|
|
jonathan183 Guru
Joined: 13 Dec 2011 Posts: 318
|
Posted: Sat Oct 12, 2013 10:37 pm Post subject: |
|
|
I can think of three ways this could work:-
1. hibernate the whole system - works and is what I have started doing for packages which take more than a couple of hours to build (like libreoffice).
2. ability to hibernate a process or program - I think this would be quite tricky to do for the general case, and likely to be less reliable than 1.
3. feature of portage/all ebuilds to allow pause/resume - which does not appear to be universally the case
1 works and is available to help with this particular case as well as others.
2 I can see being difficult to achieve, not sure if it is worth trying to achieve or not, but my use case does not justify the effort.
3 could soon become restrictive and easily broken by coders or end users. For example I had /var/tmp/portage mounted to ramdisk which would have prevented option 2 & 3 initially working. If it was a current feature of portage or all ebuilds I would have used it which is why I asked the question.
I have a workable solution to my problem - long ebuilds with a desire to switch off the system part way through, using hibernate.
The complexity of portage/ebuilds would increase to allow a universally reliable pause/resume which is unjustified, and probably one reason why --resume does not work this way |
|
Back to top |
|
|
|