summaryrefslogtreecommitdiff
path: root/src/SW/pmset-linux-workaround/document.en.rest.txt
blob: a7d59ccaef180d73e6c04cb3d93d737b8666ce86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
===================================
 Waking up a Mac at a certain time
===================================
:Id: SW/pmset-linux-workaround
:CreationDate: 2008-10-02 18:10:00
:tags: software
 
I have an old G3 iBook that I use to perform backups (using
rsnapshot_). The scripts that run the backup process start it as soon
as the machine wakes up, and put it back to sleep afterwards (using
pbbuttonsd_). Problem: every time I want to run a backup, I have to
manually wake the machine up (by pressing the power button, or opening
the lid). Clearly I'd like for the backup to happen ever if I forget,
or if I'm not at home.
 
How it works on `Mac OS X`
==========================
 
If that iBook were running `Mac OS X`, it would be easy::
 
  pmset repeat wake MTWRFSU 05:00:00
 
and it would wake up automatically, every day at 5 in the morning
(those letters are ugly abbreviations for the English names of the
days of the week).
 
But I have Linux running on that machine!
 
Can it be done in Linux?
========================
 
It seems it can't: ``drivers/macintosh/via-pmu.c``, the Power
Management Unit's driver, implements only a couple of functions.
 
Is there a hope?
================
 
I tried to use a trick. I started with the `Mac OS X` 10.4
installation disk, opened a Terminal, and run ``pmset``. Which did not
work, giving me an error 0xe00002bc. Digging a bit on the Web we
discover that such error means more or less "I can't write a
file". *Write a file*? Whoever asked for such a thing?
 
Reading more attentively the documentation_ for ``pmset``, we discover
that it writes a couple of file in
``/Library/Preferences/SystemConfiguration``. Obviously, having booted
off a CD, that directory is read-only.
 
I can't find a way to create a ``tmpfs`` or similar, so I take a USB
stick and try to mount it. It does not work: there are no drivers for
`FAT`, or something. OK, I just format it `HFS`, and finally I mount
it::
 
  mount -o union -t hfs /dev/disk5s1 /Library/Preferences/SystemConfiguration
 
I re-run ``pmset``, and finally the configuration is set.
 
Sadly it still does not work ``:-(``
 
.. _rsnapshot: http://www.rsnapshot.org/
 
.. _pbbuttonsd: http://pbbuttons.berlios.de/
 
.. _documentation:
   http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/pmset.1.html