-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2016-04-15 01:50, Chris Murphy wrote:
I don't know the details of how a Linux hibernation image is properly restored. Can someone explain that? The hibernation image is written to the swap partition, I get that part, and there is a resume= hint as a boot parameter. So the system basically cold boots up, the bootloader is executed, and runs the proper boot menu entry that includes that resume= parameter,
Without displaying the menu. That's important. The user must not try to boot anything else.
but also includes loading the kernel and the initramfs. Now what? The kernel knows to look for the hibernation image at the resume= defined swap location?
Yes
And it ignores the initramfs?
No.
Does the kernel to any kind of sanity checking to make sure it's restoring the correct hibernation file?
Yes, but I don't know what exactly it checks.
While this is not sufficient, at the very least I'd like to think that the kernel can compare its signing key to that of the one inside the hibernation image before committing to resume. If they don't match, for sure the kernel should panic before trying to write anything to disk.
Basically, the kernel starts to boot. It knows that there is the possibility that it has to read an hibernation image; at some point in boot, it suddenly checks that image. If valid, it loads that image into memory, in the position in memory that everything should be (where things where), and I will not try to imagine how. I can guess enough to know it is a nightmare. After everything is loaded, I suppose it reactivates hardware to the state it was, then passes control to some point in the just loaded image, and somehow erases itself. Perhaps at some point there is a move memory. - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlcQRUcACgkQja8UbcUWM1xEgQEAg+SWZRc49fbPRmwgpL5/bExN HliwOjM5eNIgVbzArrwBAIw1ywlP86uJ/tS7kZmsiZdvnysualcEFHUtqVG25iCU =Gb19 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org