I believe this should be done as a config file in /usr/lib/pm-utils/config.d instead, reason being that pm-utils should be the one doing the hibernate/resume methods. The hooks were never meant to be used this way.
pm-utils' mode of operation, as I understand it, is like this:
1. Execute hook scripts (suspend/hibernate)
2. Suspend/Hibernate
3. Resume
4. Execute hook scripts (resume/thaw)
Your script will cause the machine to enter hibernation halfway through step #1. So, what will happen is this.
1.1. Execute hook scripts prior to 97-quirk-hibernate-method
1.2. Begin executing hook script 97-quirk-hibernate-method
1.3. Machine halts all tasks and enters hibernation (kernel does this)
1.4. Finish executing hook script 97-quirk-hibernate-method
1.5 Continue executing hook scripts after 97-quirk-hibernate-method (suspend/hibernate, since pm-utils thinks that it has not entered hibernation yet)
Consequences:
1. pm-utils will hibernate using the kernel method on machines of that model
2. After #1, it will hibernate again, using whatever module defined in /etc/pm/config.d/00sleep_module (kernel by default, but could also be uswsusp and tuxonice).
I believe this should be done as a config file in /usr/lib/ pm-utils/ config. d instead, reason being that pm-utils should be the one doing the hibernate/resume methods. The hooks were never meant to be used this way.
pm-utils' mode of operation, as I understand it, is like this:
1. Execute hook scripts (suspend/hibernate)
2. Suspend/Hibernate
3. Resume
4. Execute hook scripts (resume/thaw)
Your script will cause the machine to enter hibernation halfway through step #1. So, what will happen is this. hibernate- method hibernate- method hibernate- method hibernate- method (suspend/hibernate, since pm-utils thinks that it has not entered hibernation yet)
1.1. Execute hook scripts prior to 97-quirk-
1.2. Begin executing hook script 97-quirk-
1.3. Machine halts all tasks and enters hibernation (kernel does this)
1.4. Finish executing hook script 97-quirk-
1.5 Continue executing hook scripts after 97-quirk-
2. Suspend/Hibernate (again!)
3. Resume
4. Execute hook scripts (resume/thaw)
Consequences: config. d/00sleep_ module (kernel by default, but could also be uswsusp and tuxonice).
1. pm-utils will hibernate using the kernel method on machines of that model
2. After #1, it will hibernate again, using whatever module defined in /etc/pm/