Changed kernels hibernate/suspend partition format may cause system damage. Nearest change - 2.6.37. Reproducible: Always Steps to Reproduce: 1. Boot 2.6.37; 2. "echo disk >/sys/power/state" (hibernate); 3. boot 2.6.36 ("swapon -s" - swap is not mounted); 4. do some work on root & other partitions 5. reboot 2.6.37 again... (outdated resume, crushed partitions). Actual Results: System damage (outdated suspend/resume). I report it in "baselayout" component, becouse it may be fixed via /etc/init.d/swap. To prevent damaging - must verify swap/suspend partition before swapon and re-format on demand. Example patch available (will be attached).
Created attachment 256492 [details, diff] swap_suspend.patch See comments inside. depend() changes may be ommited to not break standard boot behaviour, but I trying to be most safe.
Created attachment 256577 [details, diff] swap_suspend2.patch depend() changes
Please add the category/pkg you want patched to the Summary.
(In reply to comment #3) > Please add the category/pkg you want patched to the Summary. This patch for openrc. But problem also for baselayout-1. I may provide patch for baselayout-1 too, but just say where to post it ;). Also if anybody interesting about it (I use only openrc) - may be fix it self. Same (but less safe) for baselayout-1: in init.d/localmount, copy "fixswap()" code from this patch and change "/sbin/swapon -a" to "/sbin/swapon -a || fixswap". But FYI: moving swapon before localmount may cause simple problem: swap over files (vs. partitions) will don't work. This is about this openrc patch with changed "depend()" only. Say if somebody in doubts about this depend() changes and I may change & post patch (or make self by maintainers) in price of small unsafe point in boot-time between fsck+localmount & swap.
Created attachment 256826 [details, diff] baselayout1-suspend.patch To close questions: same for baselayout-1 - swapon now will be twice here, before fsck & after localmount (old). Fixme if you want, but there are just most safe. Mounting twice still also compatible with swap over files.
Can you please open a separate bug for baselayout-1? Thanks, William
Comment on attachment 256826 [details, diff] baselayout1-suspend.patch This bug will be used for openrc.
i'm not sure this is something we want to be hacking up. there is way too much magic going on in your patch to work around what is clearly documented in all linux suspend docs as "a bad idea". the kernel itself already has checks to make sure people dont go trying to resume things inappropriately. but there's only so far you can go to keep people from shooting themselves in the foot. the util-linux man page also indicates that swapon already attempts to detect & rewrite software suspend signatures for this precise reason. so if you feel that swapon isnt going far enough, feel free to start an e-mail thread on the util-linux list and/or post a patch to improve it.