Bug#640323: reconfiguring uswsusp doesn't detect swap file as active

2013-12-28 Thread Rohan Jain
Hi Rodolfo,

Thanks for posting this solution. But I wont be able to try it on my
current system. Will give a feedback on it, when I am back on Debian.
I am sure this will help out someone who is stuck at a similar place.

On Fri, Dec 27, 2013 at 9:46 PM, Rodolfo García Peñas (kix) k...@kix.es wrote:
 Hi,

 Sorry, but I think there was some problems with this mail. I am forwarding
 it.

 Cheers
 kix

 
 De: Rodolfo García Peñas (kix) k...@debian.org
 Enviado: Fri Dec 27 15:23:10 CET 2013
 Para: 640...@bugs.debian.org; Rohan Jain crod...@gmail.com
 Asunto: Re: reconfiguring uswsusp doesn't detect swap file as active

 Hi Rohan,

 thanks for your report.

 Could you try this? (as root)

 1. Backup the uswsusp.config file: cp
 /var/lib/dpkg/info/uswsusp.config
 /var/lib/dpkg/info/uswsusp.config-backup
 2. Replace this code in the file /var/lib/dpkg/info/uswsusp.config
 (line 36 and more):

uuid=$tmpswap
for path in /dev/disk/by-uuid/*; do
link=$(readlink -f $path)
if [ $link = $tmpswap ]; then
uuid=${path}
break;
fi
done
 ---

# Check if tmpswap is already in uuid format
if ! [[ $tmpswap == /dev/disk/by-uuid* ]]; then
# Test every uuid device
uuid=$tmpswap
for path in /dev/disk/by-uuid/*; do
link=$(readlink -f $path)
if [ $link = $tmpswap ]; then
uuid=${path}
break;
fi
done
fi


 As you can see, I only added this lines (on top):

# Check if tmpswap is already in uuid format
if ! [[ $tmpswap == /dev/disk/by-uuid* ]]; then
# Test every uuid device


 and finish with an fi

fi


 This change tests if the $tmpswap device is already
 /dev/disk/by-uuid/xxx
 format.

 Now you can run dpkg-reconfigure uswsusp and the problem should be solved.

 If this change doesn't solve the problem, please, send me your
 /etc/uswsusp.conf file to check it.

 Thanks a lot for your help.
 kix

 PS. Do not forget undo the changes (if you want, of course): mv
 /var/lib/dpkg/info/uswsusp.config-backup
 /var/lib/dpkg/info/uswsusp.config
 --
   .''`.
 : :'  : Rodolfo García Peñas (kix) k...@debian.org
 `. `'`  Proud Debian Developer
   `-


 --
 Enviado desde mi teléfono con K-9 Mail.



-- 
Thanks
Rohan Jain


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#640323: reconfiguring uswsusp doesn't detect swap file as active

2013-12-27 Thread kix
Hi,

Sorry, but I think there was some problems with this mail. I am forwarding it.

Cheers
kix


 Mensaje Original 
De: Rodolfo García Peñas (kix) k...@debian.org
Enviado: Fri Dec 27 15:23:10 CET 2013
Para: 640...@bugs.debian.org; Rohan Jain crod...@gmail.com
Asunto: Re: reconfiguring uswsusp doesn't detect swap file as active

Hi Rohan,

thanks for your report.

Could you try this? (as root)

1. Backup the uswsusp.config file: cp
/var/lib/dpkg/info/uswsusp.config
/var/lib/dpkg/info/uswsusp.config-backup
2. Replace this code in the file /var/lib/dpkg/info/uswsusp.config
(line 36 and more):

   uuid=$tmpswap
   for path in /dev/disk/by-uuid/*; do
   link=$(readlink -f $path)
   if [ $link = $tmpswap ]; then
   uuid=${path}
   break;
   fi
   done
---
   # Check if tmpswap is already in uuid format
   if ! [[ $tmpswap == /dev/disk/by-uuid* ]]; then
   # Test every uuid device
   uuid=$tmpswap
   for path in /dev/disk/by-uuid/*; do
   link=$(readlink -f $path)
   if [ $link = $tmpswap ]; then
   uuid=${path}
   break;
   fi
   done
   fi

As you can see, I only added this lines (on top):

   # Check if tmpswap is already in uuid format
   if ! [[ $tmpswap == /dev/disk/by-uuid* ]]; then
   # Test every uuid device

and finish with an fi

   fi

This change tests if the $tmpswap device is already
/dev/disk/by-uuid/xxx format.

Now you can run dpkg-reconfigure uswsusp and the problem should be solved.

If this change doesn't solve the problem, please, send me your
/etc/uswsusp.conf file to check it.

Thanks a lot for your help.
kix

PS. Do not forget undo the changes (if you want, of course): mv
/var/lib/dpkg/info/uswsusp.config-backup
/var/lib/dpkg/info/uswsusp.config
--
  .''`.
: :'  : Rodolfo García Peñas (kix) k...@debian.org
`. `'`  Proud Debian Developer
  `-

-- 
Enviado desde mi teléfono con K-9 Mail.

Bug#640323: reconfiguring uswsusp doesn't detect swap file as active

2011-09-04 Thread Rohan Jain
Package: uswsusp
Version: 1.0+20110509-1.1
Severity: normal

Dear Maintainer,

   I am using the save to disk option for swap files instead of swap
   partitions, following this guide:
   http://wiki.debian.org/Hibernation/Hibernate_Without_Swap_Partition
   It works fine the first time (Installing uswsusp after activating the
   swap file).
   But when I create a new swap file and run dpkg-reconfigure get newer
   configuration to effect in the kernel and uswsusp config, I get this
   message:

   The swap file or partition that was found in uswsusp's configuration 
file is not active.
   In most cases this means userspace software suspend will not work as 
expected. You should choose
   another swap space.
   However, in some rare cases, this configuration may be intentional.
   Continue without a valid swap space?

   And then whatever I choose (y/n) the new configuration for uswsusp
   and kernel won't be  generated.

   To work around this I have to first remove the uswsusp package and
   then install it again.

   Is there some other way to update the configs? I have tried using
   the swap-offset utility and edit uswsusp.conf manually, but that
   doesn't work as the kernel doesn't know the offset. I didn't go
   further with editing kernel files.

   I have written this script:
   https://github.com/crodjer/scripts/blob/master/hibernator.sh, mainly
   targeted to delete the swap file created on resume, to retrieve my
   disk space back. But for it to work, I have to run apt purge-install
   pair instead of reconfiguring.
   This will show you exactly what steps I am taking for creating and
   handling swap files.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages uswsusp depends on:
ii  debconf [debconf-2.0]  1.5.41
ii  libc6  2.13-18   
ii  libgcrypt111.5.0-3   
ii  liblzo2-2  2.05-2
ii  libpci31:3.1.7-12
ii  libx86-1   1.1+ds1-7 

Versions of packages uswsusp recommends:
ii  initramfs-tools  0.99
ii  mount2.19.1-5

uswsusp suggests no packages.

-- debconf information:
  uswsusp/compute_checksum: false
  uswsusp/no_snapshot:
  uswsusp/suspend_loglevel:
  uswsusp/no_swap:
  uswsusp/resume_offset: 2293760
  uswsusp/early_writeout: true
  uswsusp/image_size: 2.81697e+09
  uswsusp/compress: true
  uswsusp/create_RSA_key: false
  uswsusp/snapshot_device:
  uswsusp/RSA_key_file: /etc/uswsusp.key
  uswsusp/max_loglevel:
  uswsusp/resume_device: /dev/sda1
  uswsusp/shutdown_method: platform
  uswsusp/encrypt: false
  uswsusp/splash: true
  uswsusp/RSA_key_bits: 1024
  uswsusp/continue_without_swap: true



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org