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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

On Thursday 05 January 2006 22:50, Pavel Machek wrote:
> On Fri 06-01-06 17:16:30, Andrey Borzenkov wrote:
> > -----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.

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-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux