From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id ED95C1389E2 for ; Sat, 6 Dec 2014 07:38:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C1A26E0851; Sat, 6 Dec 2014 07:38:20 +0000 (UTC) Received: from smtpq5.tb.mail.iss.as9143.net (smtpq5.tb.mail.iss.as9143.net [212.54.42.168]) by pigeon.gentoo.org (Postfix) with ESMTP id 9428BE0844 for ; Sat, 6 Dec 2014 07:38:19 +0000 (UTC) Received: from [212.54.42.134] (helo=smtp3.tb.mail.iss.as9143.net) by smtpq5.tb.mail.iss.as9143.net with esmtp (Exim 4.82) (envelope-from ) id 1Xx9wY-0001mB-L5 for gentoo-user@lists.gentoo.org; Sat, 06 Dec 2014 08:38:18 +0100 Received: from 53579160.cm-6-8c.dynamic.ziggo.nl ([83.87.145.96] helo=data.antarean.org) by smtp3.tb.mail.iss.as9143.net with esmtp (Exim 4.82) (envelope-from ) id 1Xx9wY-0001sd-0F for gentoo-user@lists.gentoo.org; Sat, 06 Dec 2014 08:38:18 +0100 Received: from andromeda.localnet (unknown [10.20.13.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by data.antarean.org (Postfix) with ESMTPSA id B608A4B for ; Sat, 6 Dec 2014 08:38:01 +0100 (CET) From: "J. Roeleveld" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] hibernation Date: Sat, 06 Dec 2014 08:38:20 +0100 Message-ID: <34613076.cLnunO0tU3@andromeda> Organization: Antarean User-Agent: KMail/4.12.5 (Linux/3.16.5-gentoo; KDE/4.12.5; x86_64; ; ) In-Reply-To: <1450AC75-3E80-43CA-835B-3D6629D9E3F8@antarean.org> References: <547EE6AA.5060601@uni-konstanz.de> <54809AA0.80805@uni-konstanz.de> <1450AC75-3E80-43CA-835B-3D6629D9E3F8@antarean.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2752737.lE7ZWEdDIE" Content-Transfer-Encoding: 7Bit X-Ziggo-spambar: ---- X-Ziggo-spamscore: -4.8 X-Ziggo-spamreport: ALL_TRUSTED=-1,BAYES_00=-1.9,PROLO_TRUST_RDNS=-3,RDNS_DYNAMIC=0.982,TW_LV=0.077 X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No X-Archives-Salt: e4ce36e5-e6f9-43b0-9379-0082f93facf9 X-Archives-Hash: 878c03fc9b54de1b799b9b7d408dece8 This is a multi-part message in MIME format. --nextPart2752737.lE7ZWEdDIE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On Thursday, December 04, 2014 07:52:44 PM J. Roeleveld wrote: > On 4 December 2014 18:32:16 CET, Michael Vetter wrote: > >Am 04/12/14 18:10, schrieb Randolph Maa=DFen: > >> 2014-12-04 17:58 GMT+01:00 Michael Vetter > > > >: > >>>> Did you try suspending using the echo command I mentioned earlie= r? > >>>=20 > >>> Yes, it seemed to work (just starting up again didn't). > >>>=20 > >>>> You can set the resume partition in the kernel. Might be an opti= on. > >>>=20 > >>> Okay, so I changed my kernel command string from "root=3D/dev/sdb= 2" to > >>> "root=3D/dev/sdb2,resume=3D/dev/mapper/g-SWAP". > >>=20 > >> In my menuconfig I have a space separated list, not comma separate= d. > >> So I guess the boot failure is, that the kernel can't find the roo= t > >> partition /dev/sdb2,resume... > > > >Okay, sorry thought this is equivalent to [1]. > >Anyways, I changed it to space and my system boots now. > >So I tried the suspend command again, but when rebooting its like a > >fresh reboot. > > > >Any ideas? > > > >[1] http://man7.org/linux/man-pages/man7/bootparam.7.html >=20 > Yes. > If using LVM for the swap partition (and subsequently the resume) you= need > to use an initramfs. >=20 > I will dig out the script I use on my laptop and post it tomorrow. (I= t boots > faster with a custom script compared to the genkernel or dracut ones)= Bit later then planned. The "init" file is the initramfs init-file. The "config" is what I configure in the kernel: $ zcat /proc/config.gz | grep initramfs CONFIG_INITRAMFS_SOURCE=3D"/usr/src/initramfs/config" There are a few changes you'll need to do: 1) In the "init" file, change the name of the swap-partition you use 2) In the "config" file, change the following paths: - init-file 3) In the "config" file, run the command mentioned at the end of the fi= le and add the result of the command to the end of the " config " file. I have been using this config succesfully for over a year on my laptop.= -- Joost --nextPart2752737.lE7ZWEdDIE Content-Disposition: attachment; filename="config" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="config" # vim: set ft=initramfs : # init script file /init /usr/src/initramfs/init 0755 0 0 # basic device nodes dir /dev 0755 0 0 nod /dev/console 0600 0 0 c 5 1 # mount point for our real root dir /root 0700 0 0 dir /lib 0755 0 0 dir /etc 755 0 0 # utilities needed to do anything useful dir /bin 0755 0 0 dir /sbin 0755 0 0 dir /usr 755 0 0 dir /usr/lib 755 0 0 dir /usr/sbin 755 0 0 dir /usr/bin 755 0 0 dir /lib64 755 0 0 dir /usr/lib64 755 0 0 file /bin/busybox /bin/busybox 0755 0 0 # some busybox symlinks slink /bin/dd busybox 777 0 0 slink /bin/cp busybox 777 0 0 slink /bin/df busybox 777 0 0 slink /bin/ln busybox 777 0 0 slink /bin/ls busybox 777 0 0 slink /bin/mv busybox 777 0 0 slink /bin/ps busybox 777 0 0 slink /bin/rm busybox 777 0 0 slink /bin/sh busybox 777 0 0 slink /bin/vi busybox 777 0 0 slink /bin/ash busybox 777 0 0 slink /bin/cat busybox 777 0 0 slink /bin/pwd busybox 777 0 0 slink /bin/sed busybox 777 0 0 slink /bin/tar busybox 777 0 0 slink /bin/date busybox 777 0 0 slink /bin/echo busybox 777 0 0 slink /bin/grep busybox 777 0 0 slink /bin/gzip busybox 777 0 0 slink /bin/kill busybox 777 0 0 slink /bin/more busybox 777 0 0 slink /bin/ping busybox 777 0 0 slink /bin/sync busybox 777 0 0 slink /bin/true busybox 777 0 0 slink /bin/zcat busybox 777 0 0 slink /bin/chgrp busybox 777 0 0 slink /bin/chmod busybox 777 0 0 slink /bin/chown busybox 777 0 0 slink /bin/dmesg busybox 777 0 0 slink /bin/egrep busybox 777 0 0 slink /bin/false busybox 777 0 0 slink /bin/fgrep busybox 777 0 0 slink /bin/mkdir busybox 777 0 0 slink /bin/mknod busybox 777 0 0 slink /bin/mount busybox 777 0 0 slink /bin/pidof busybox 777 0 0 slink /bin/rmdir busybox 777 0 0 slink /bin/sleep busybox 777 0 0 slink /bin/touch busybox 777 0 0 slink /bin/uname busybox 777 0 0 slink /bin/gunzip busybox 777 0 0 slink /bin/hostname busybox 777 0 0 slink /bin/mktemp busybox 777 0 0 slink /bin/umount busybox 777 0 0 slink /bin/usleep busybox 777 0 0 slink /usr/bin/[ ../../bin/busybox 777 0 0 slink /usr/bin/du ../../bin/busybox 777 0 0 slink /usr/bin/id ../../bin/busybox 777 0 0 slink /usr/bin/tr ../../bin/busybox 777 0 0 slink /usr/bin/wc ../../bin/busybox 777 0 0 slink /usr/bin/cmp ../../bin/busybox 777 0 0 slink /usr/bin/cut ../../bin/busybox 777 0 0 slink /usr/bin/env ../../bin/busybox 777 0 0 slink /usr/bin/tee ../../bin/busybox 777 0 0 slink /usr/bin/tty ../../bin/busybox 777 0 0 slink /usr/bin/yes ../../bin/busybox 777 0 0 slink /usr/bin/chvt ../../bin/busybox 777 0 0 slink /usr/bin/find ../../bin/busybox 777 0 0 slink /usr/bin/expr ../../bin/busybox 777 0 0 slink /usr/bin/free ../../bin/busybox 777 0 0 slink /usr/bin/head ../../bin/busybox 777 0 0 slink /usr/bin/deallocvt ../../bin/busybox 777 0 0 slink /usr/bin/tail ../../bin/busybox 777 0 0 slink /usr/bin/sort ../../bin/busybox 777 0 0 slink /usr/bin/test ../../bin/busybox 777 0 0 slink /usr/bin/time ../../bin/busybox 777 0 0 slink /usr/bin/uniq ../../bin/busybox 777 0 0 slink /usr/bin/wget ../../bin/busybox 777 0 0 slink /usr/bin/dirname ../../bin/busybox 777 0 0 slink /usr/bin/killall ../../bin/busybox 777 0 0 slink /usr/bin/clear ../../bin/busybox 777 0 0 slink /usr/bin/bzcat ../../bin/busybox 777 0 0 slink /usr/bin/reset ../../bin/busybox 777 0 0 slink /usr/bin/unzip ../../bin/busybox 777 0 0 slink /usr/bin/which ../../bin/busybox 777 0 0 slink /usr/bin/xargs ../../bin/busybox 777 0 0 slink /usr/bin/strings ../../bin/busybox 777 0 0 slink /usr/bin/logger ../../bin/busybox 777 0 0 slink /usr/bin/openvt ../../bin/busybox 777 0 0 slink /usr/bin/hexdump ../../bin/busybox 777 0 0 slink /usr/bin/uptime ../../bin/busybox 777 0 0 slink /usr/bin/whoami ../../bin/busybox 777 0 0 slink /usr/bin/readlink ../../bin/busybox 777 0 0 slink /usr/bin/install ../../bin/busybox 777 0 0 slink /usr/bin/basename ../../bin/busybox 777 0 0 slink /usr/bin/bunzip2 ../../bin/busybox 777 0 0 slink /sbin/halt ../bin/busybox 777 0 0 slink /sbin/init ../bin/busybox 777 0 0 slink /sbin/klogd ../bin/busybox 777 0 0 slink /sbin/route ../bin/busybox 777 0 0 slink /sbin/poweroff ../bin/busybox 777 0 0 slink /sbin/swapoff ../bin/busybox 777 0 0 slink /sbin/switch_root ../bin/busybox 777 0 0 slink /sbin/syslogd ../bin/busybox 777 0 0 slink /sbin/ifconfig ../bin/busybox 777 0 0 slink /sbin/reboot ../bin/busybox 777 0 0 slink /sbin/pivot_root ../bin/busybox 777 0 0 slink /sbin/swapon ../bin/busybox 777 0 0 slink /sbin/mdev ../bin/busybox 777 0 0 slink /usr/sbin/chroot ../../bin/busybox 777 0 0 # end of busybox symlinks # lvm configuration dir /etc/lvm 755 0 0 file /etc/lvm/lvm.conf /etc/lvm/lvm.conf 644 0 0 file /sbin/lvm /sbin/lvm 555 0 0 slink /sbin/vgchange lvm 777 0 0 slink /sbin/vgscan lvm 777 0 0 dir /var 755 0 0 dir /var/log 755 0 0 dir /var/lock 755 0 0 # proc and sysfs mountpoints dir /proc 755 0 0 dir /sys 755 0 0 dir /newroot 755 0 0 # Auto-add dependencies - Run following command as root and paste the output below # for i in lvm busybox ; do ldd `which ${i}` | cut -d'>' -f2 | awk '{print $1}' ; done | sort -u | grep -v linux-vdso.so.1 | grep -v not | sed 's/\(.*\)/file \1 \1 0755 0 0/' --nextPart2752737.lE7ZWEdDIE Content-Disposition: attachment; filename="init" Content-Transfer-Encoding: 7Bit Content-Type: application/x-shellscript; name="init" #!/bin/sh rescue_shell() { echo "Something went wrong. Dropping you to a shell." busybox --install -s exec /bin/sh } /bin/mount -t proc proc /proc || rescue_shell /bin/mount -t sysfs sysfs /sys || rescue_shell /bin/mount -t devtmpfs devtmpfs /dev || rescue_shell /sbin/vgscan --mknodes /sbin/vgchange -ay wait || rescue_shell # Replace device with the resume (swap) partition local device=$(ls -lL "/dev/mapper/vg_andromeda_sda4-swap" | sed 's/\ */ /g' | cut -d \ -f 5-6 | sed 's/,\ */:/') [ -f /sys/power/resume ] && echo "${device}" > /sys/power/resume /bin/mount -t ext4 -onoatime,discard /dev/mapper/vg_andromeda_sda4-root /newroot || rescue_shell /bin/mount -t devtmpfs none /newroot/dev || rescue_shell /bin/mount -t proc none /newroot/proc || rescue_shell /bin/mount -t sysfs none /newroot/sys || rescue_shell /bin/umount /proc /bin/umount /sys /bin/umount /dev exec switch_root /newroot /sbin/init || rescue_shell --nextPart2752737.lE7ZWEdDIE--