You are not logged in.

#1 2012-02-17 21:06:34

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Decyphering some code

I am trying to find out how to power off and on UltraBay in my ThinkPad laptop. So far, I got halfway.

From this I discovered how to power it off:
https://github.com/linrunner/TLP/blob/m … -functions
The command is

echo 1 > /sys/devices/platform/dock.2/undock 

This file is write-only, by the way.

Now, I was looking for a method to power it back on here:
https://github.com/linrunner/TLP/blob/master/49bay
but I can't figure it out.

Simply doing

echo 0 > /sys/devices/platform/dock.2/undock 

does nothing, and /sys/devices/platform/dock.2/docked is read-only.

Can someone give me a hand with it?

Last edited by Lockheed (2012-02-17 23:17:57)

Offline

#2 2012-02-17 23:17:20

allen875
Member
From: Winchester, VA
Registered: 2011-09-02
Posts: 46
Website

Re: Decyphering some code

your second command is the same as the power down command? Is this a typo or are you using the power down command to try and power it up and not realizing it?
Did you try dock instead of undock.

echo 1 > /sys/devices/platform/dock.2/dock

Last edited by allen875 (2012-02-17 23:18:17)

Offline

#3 2012-02-17 23:18:19

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Decyphering some code

A typo. I meant 0

Offline

#4 2012-02-18 08:54:28

allen875
Member
From: Winchester, VA
Registered: 2011-09-02
Posts: 46
Website

Re: Decyphering some code

Lockheed wrote:

A typo. I meant 0

Did you try it with the dock instead of undock at the end?

Offline

#5 2012-02-18 09:34:53

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Decyphering some code

Yes. Permission denied. File only for read access. If I change it to rw, it does nothing.

Offline

#6 2012-02-18 10:38:15

allen875
Member
From: Winchester, VA
Registered: 2011-09-02
Posts: 46
Website

Re: Decyphering some code

have you tried it with root permissions?

sudo echo 1 > /sys/devices/platform/dock.2/dock

This might be a good read too depending on exactly what your using. Link Here.

Last edited by allen875 (2012-02-18 10:40:11)

Offline

#7 2012-02-18 10:50:05

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,680

Re: Decyphering some code

allen875 wrote:

have you tried it with root permissions?

sudo echo 1 > /sys/devices/platform/dock.2/dock

Actually,

sudo echo foo > ....

doesn't work like you expect.  You should either use su or tee
http://stackoverflow.com/questions/8488 … an-alterna

Last edited by skunktrader (2012-02-18 10:50:57)

Offline

#8 2012-02-18 13:30:34

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Decyphering some code

Of course I am using su. Otherwise even the first command didn't work.
So please consider my original question keeping in mind I am doing things under 'su'.

Offline

Board footer

Powered by FluxBB