Hello, i am experiencing problem using /etc/init.d/hibernate-cleanup and LABELed swap partition on linux. It because this sript runs mkswap without -L option. swap parttion is than not found and also not used for that reason. My /etc/fstab looks like this: LABEL=swap none swap sw 0 0 possible patch, but afaik vol_id is available on udev systems only # equery b `which vol_id` [ Searching for file(s) /sbin/vol_id in *... ] sys-fs/udev-087 (/sbin/vol_id) --- /etc/init.d/hibernate-cleanup.orig 2006-07-19 01:51:20.000000000 +0200 +++ /etc/init.d/hibernate-cleanup 2006-07-19 18:01:08.000000000 +0200 @@ -29,8 +29,9 @@ local where wason where=$1 wason= + mkswap_label="`vol_id /dev/sda5 | 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 $mkswap_label $where > /dev/null || echo -n " (failed: $?)" [ -n "$wason" ] && swapon $where }
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 ..