|
Bugzilla – Full Text Bug Listing |
| Summary: | systemd - point grub at the right entry before hibernating | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Tumbleweed | Reporter: | Vojtech Dziewiecki <vdziewiecki> |
| Component: | Basesystem | Assignee: | Thomas Blume <thomas.blume> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Major | ||
| Priority: | P5 - None | CC: | fcrozat, forgotten_GTSR6JWjet, ihno, jslaby, mchang, systemd-maintainers, thomas.blume, tiwai |
| Version: | 13.2 Milestone 0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | SUSE Other | ||
| Whiteboard: | |||
| Found By: | Development | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
grub.sh, should go to /usr/lib/systemd/system-sleep
Updated script (that should still go to /usr/lib/systemd/system-sleep) Script updated again systemd-sleep-grub |
||
Created attachment 574877 [details]
Updated script (that should still go to /usr/lib/systemd/system-sleep)
This script is slightly improved version of previously attached (by Wojtek). This one works good for me.
(In reply to comment #0) > Created an attachment (id=572623) [details] Hello Wojtek, Thanks for the script, I've tested it on my box and made some small fixes and modifications. You can review them, my version is attachment #2 [details] here. Nikolai And sorry for messing up attachments, I'm not too used to this bugzilla... (Luckily there is still "Show obsolete" button) What exactly is this change about? I've seen the diff but it's still not clear to me.. (In reply to comment #4) > What exactly is this change about? I've seen the diff but it's still not clear > to me.. Actually just 3 trivial things: 1. Instead of relying on previously saved copy of grub's environment file (/var/run/suspend.grubonce.default) to restore normal grub behaviour (unlock current entry), use grub2-editenv to explicitely remove (the previously added) "next_entry" from current environment file. This method seems to work more reliable for me, although in theory it should not matter much. 2. The invocation of grub2-editenv needs to explicitely specify actual grub's environment file name (/boot/grub2/grubenv = GRUBDEFAULT) as first argument, otherwise it sees to complain and not work; 3. The "prepare-parameters" line was added to "grub-once-restore()". Without this line, all used variables (like GRUBDEFAULT) are empty and so the function has no action. That's all. Thank you. Nikolai Created attachment 579344 [details]
Script updated again
There was one mistake, there was suspend_hybrid instead of hybrid-sleep, I fixed that.
BTW hybrid-sleep does not work I think, but that's off topic.
(In reply to comment #5) > Actually just 3 trivial things: > > 1. Instead of relying on previously saved copy of grub's environment file > (/var/run/suspend.grubonce.default) to restore normal grub behaviour (unlock > current entry), use grub2-editenv to explicitely remove (the previously added) > "next_entry" from current environment file. This method seems to work more > reliable for me, although in theory it should not matter much. Good catch. This helps in the case that grub can't write to grubenv file and clear the flag, due to /boot partition is not physical (ie software raid or logical volume). This fixes the annoying bug which system permanently booting to the hibernated kernel entry. > > 2. The invocation of grub2-editenv needs to explicitely specify actual grub's > environment file name (/boot/grub2/grubenv = GRUBDEFAULT) as first argument, > otherwise it sees to complain and not work; list does not require the environment file name and set/unset does. But agree that it's better practice we explicit specify it (and follow it's syntax described in man page). > > 3. The "prepare-parameters" line was added to "grub-once-restore()". Without > this line, all used variables (like GRUBDEFAULT) are empty and so the function > has no action. Yes this is required. Btw. using systemd for hibernation/suspend will obsolete: Forward-suspend-hibernate-calls-to-pm-utils.patch Frederic, this was your patch from bug 790157. Should I remove it? (In reply to comment #19) > Btw. using systemd for hibernation/suspend will obsolete: > Forward-suspend-hibernate-calls-to-pm-utils.patch > Frederic, this was your patch from bug 790157. > Should I remove it? yes, go ahead, you have my blessing to remove this dirty hack :) Created attachment 583605 [details] systemd-sleep-grub script together with patch from bug 856389 submitted to factory Patch submitted to SLE-12 Checked usr/lib/pm-utils/sleep.d/99Zgrub from pm-utils on s390x. It is the same script like on the other architectures. Hence my converted script should work on s390x too. closing this bug as fixed. *** Bug 869711 has been marked as a duplicate of this bug. *** openSUSE-RU-2016:0320-1: An update that has 146 recommended fixes can now be installed. Category: recommended (moderate) Bug References: 737690,742774,750845,818044,838475,841544,849870,852015,852021,852232,853293,854884,856389,856392,856858,857204,858864,859072,859365,860574,860937,861316,861489,863217,864745,864904,865834,866732,866933,867128,867663,867664,867840,868019,868230,868439,868931,869142,869603,872929,873432,873444,874665,875502,876587,876694,877021,877674,878525,880438,880732,881125,881559,881942,882393,882714,883565,884271,884403,885232,885288,886211,886599,886852,888178,888215,888612,889297,889357,890977,892096,892162,892300,893797,895087,896664,897799,897801,897803,898233,898240,898432,900558,901481,902240,902901,903009,903963,904214,904517,904828,905550,906709,906900,907318,907393,908476,909358,910643,911347,912030,912334,913517,916420,918118,919095,920195,921831,921898,921920,926169,927250,927457,928265,931388,932284,933365,933512,933521,933533,934077,934901,937512,937900,938908,939571,940264,941576,944132,944799,945282,947212,948458,948555,948705,949574,949683,949739,950510,951265,951663,953241,954336,954781,955635,961576 CVE References: Sources used: openSUSE 13.1 (src): systemd-210-40.1, systemd-mini-210-40.1 |
Created attachment 572623 [details] grub.sh, should go to /usr/lib/systemd/system-sleep Hi, I believe this functionality has to be added before switching from pm-utils to systemd suspend/hibernate. When a computer is turned on after hibernating, grub must chose the right entry automatically, and not let the user chose. If the user would choose to boot into another OS, bad things could happen. To fix this, just put the attached script to /usr/lib/systemd/system-sleep. Thanks, Wojtek