Skip to contentSkip to conversation

swsusp vs. modular IDE (or wherever your swap is)

DISCUSSION Andrey Borzenkov 2 participants 3 messages Jan 6, 2006 – Jan 29, 2006

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do I understand correctly that swsusp requires drivers for primary swap to be compiled in kernel? It appears that initrd-based implementation is possible (load drivers for resume partition and then attempt to do manual resume via "echo x:y > /sys/power/resume") - are there any issues associated with it?

TIA

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDvnu/R6LMutpd94wRAveZAKC9Vz5a7My6zphTjCeXcelrTcQQOwCfWM1Q 8v/z+GMDfYuSj6sgZGghCKI=
=8+Hb
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 7 lines · Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do I understand correctly that swsusp requires drivers for primary swap to be compiled in kernel? It appears that initrd-based implementation is possible (load drivers for resume partition and then attempt to do manual resume via "echo x:y > /sys/power/resume") - are there any issues associated with it?

Except that it eats any mounted filesystems? No. Do mounts after echo and you should be fine.

Signature · 1 line
Thanks, Sharp!
#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Pavel Machek
Quoted 3 lines · Andrey Borzenkov

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines
Quoted 5 lines

Do I understand correctly that swsusp requires drivers for primary swap to be compiled in kernel? It appears that initrd-based implementation is possible (load drivers for resume partition and then attempt to do manual resume via "echo x:y > /sys/power/resume") - are there any issues associated with it?

Except that it eats any mounted filesystems? No. Do mounts after echo and you should be fine.

well, this did not work at least naively. It correctly sets resume device and I can suspend. But on resume I see "Stopping tasks: ====" after this booting continues. I enabled debug but do not see anything at this moment.

Contents of linuxrc up to resume point:

{pts/0}% sudo cat /tmp/rc/linuxrc
#!/bin/nash

echo "Loading ide-core.ko module"
insmod /lib/ide-core.ko
echo "Loading alim15x3.ko module"
insmod /lib/alim15x3.ko
echo "Loading ide-disk.ko module"
insmod /lib/ide-disk.ko
echo "Loading reiserfs.ko module"
insmod /lib/reiserfs.ko
echo Mounting /proc filesystem
mount -t proc /proc /proc
echo Mounting sysfs
mount -t sysfs none /sys
echo Creating device files
mountdev size=32M,mode=0755
echo -n /sbin/hotplug > /proc/sys/kernel/hotplug
mkdir /dev/.udevdb
mkdevices /dev
echo Attempting resume
resume

resume is builtin (on top of RH/Mandriva nash):

int resumeCommand(char * cmd, char * end) {
    char buf[20];
    struct stat statbuf;
    int fd;
    int size;
    char *resume, *rend;

    resume = getKernelArg("resume=");
    if (resume == NULL)
        return 0;
    rend = resume;
    while (*rend && !isspace(*rend)) rend++;
    *rend = '\0';

    if ((stat(resume, &statbuf) == 0)) {
        fd = open("/sys/power/resume", O_RDWR, 0);
        if (fd < 0)
            return 1;
        size = snprintf(buf, sizeof(buf), "%u:%u",
                        major(statbuf.st_rdev), minor(statbuf.st_rdev));
        if (size <= sizeof(buf))
            write(fd, buf, size);
        /* SHOULD NOT REACH HERE */
    }

    close(fd);
    return 1;
}

and I boot with resume=/dev/hda1

Unfortunately, serial console is near to impossible (it is notebook without COM port :(

- -andrey

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD3RcNR6LMutpd94wRArkwAJ94fiVsVaOO9INJieJqsjgvnc/DvACgqSR5 6LxKuaVPSzXKaEyMml9cT+4=
=a4Zh
-----END PGP SIGNATURE-----