Summary: | sys-power/hibernate-script-1.93-r3 - hibernate-cleanup do mkswap not labeling partition | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Pavel Ruzicka <ruza> |
Component: | New packages | Assignee: | Christian Heim (RETIRED) <phreak> |
Status: | RESOLVED LATER | ||
Severity: | enhancement | CC: | mobile+disabled |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | hibernate-cleanup-swaplabel.patch for udev systems |
Description
Pavel Ruzicka
2006-07-19 09:13:13 UTC
Created attachment 92217 [details, diff]
hibernate-cleanup-swaplabel.patch for udev systems
yet another fix in my patch (missing $where)
No idea what installs /etc/init.d/hibernate-cleanup... Reopen with ebuild name and version. # equery b /etc/init.d/hibernate-cleanup sys-power/hibernate-script-1.93-r3 (/etc/init.d/hibernate-cleanup) I slightly altered it a bit (udev-096-r1 is having vol_id in /lib/udev), but the rest is nearly the same ... Index: hibernate-script-1.93/init.d/hibernate-cleanup.sh =================================================================== --- hibernate-script-1.93.orig/init.d/hibernate-cleanup.sh +++ hibernate-script-1.93/init.d/hibernate-cleanup.sh @@ -26,11 +26,19 @@ get_swap_id() { } clear_swap() { - local where wason + local where wason swap_label vol_id where=$1 wason= + + if [ -e /sbin/vol_id ] ; then + vol_id="/sbin/vol_id" + elif [ -e /lib/udev/vol_id ] ; then + vol_id="/lib/udev/vol_id" + fi + + swap_label="$( ${vol_id} $where | awk -F = '$1 ~ /^ID_FS_LABEL$/ && $2 !~ /^$/ {print "-L", $2}' )" swapoff $where 2>/dev/null && wason=yes - mkswap $where > /dev/null || echo -n " (failed: $?)" + mkswap $swap_label $where > /dev/null || echo -n " (failed: $?)" [ -n "$wason" ] && swapon $where } I guess I have to close that as LATER. I can't depend on it that everyone has udev on his system .. |