Alternative solution for Gentoo bug #269603
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 19 Jul 2009 19:47:05 +0000 (14:47 -0500)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 19 Jul 2009 19:47:05 +0000 (14:47 -0500)
ChangeLog
defaults/initrd.scripts

index 6ad8947ce34587687e55a643e551ff7fb0e28ca4..ff3c107218d874a94cea30f65b04042bd6080495 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 
+  19 Jul 2009; Andrew Gaffney <agaffney@gentoo.org> defaults/initrd.scripts:
+  Alternative solution for Gentoo bug #269603
+
   19 Jul 2009; Andrew Gaffney <agaffney@gentoo.org> defaults/initrd.scripts:
   Change command used to determine real filename for REAL_RESUME for Gentoo
   bug #269603
index 66130ae33355b5ddb2526a4881c863f2bf673800..1f9372e43bc42c7d65d01f094d29b8a10dfe9550 100755 (executable)
@@ -858,7 +858,7 @@ rundebugshell() {
 
 swsusp_resume() {
        # determine swap resume partition
-       local device=$(ls -lL "${REAL_RESUME}" | sed 's/\  */ /g' | cut -d \  -f 5-6 | sed 's/,\ */:/')
+       local device=$(get_real_filename "${REAL_RESUME}")
        [ -f /sys/power/resume ] && echo "${device}" > /sys/power/resume
        return 0
 }
@@ -987,3 +987,13 @@ setup_unionfs() {
                USE_UNIONFS_NORMAL=0
        fi
 }
+
+get_real_filename() {
+       local file=$1
+
+       if [ -L "${file}" ]; then
+               readlink ${file}
+       elif [ -f "${file}" ]; then
+               echo "${file}"
+       fi
+}