Project

General

Profile

running startup scripts in Replicant

Added by Fernando Negro almost 8 years ago

Hi everyone.
I'm new to the smartphones world and to Replicant - and, so far, I've been liking very much to use this Freedom and Privacy-respecting alternative to Android and CyanogenMod.
Having been looking, for a long time, for an alternative to my iPod Touch, where I could have some privacy, I recently decided to buy a smartphone with a particularly good sound, that is supported by Replicant - the Nexus S. But, wanting to use this smartphone only as a minitablet and music player, I would like to "deactivate" the phone part of it - namely, to save battery.
I know that it is possible to do so in CyanogenMod, following this instructions: http://forum.xda-developers.com/showthread.php?t=1217038
But, in such instructions, it's necessary to install a proprietary app, that manages the script to be run at boot, to deactivate the cell phone radio.
The script is a very simple one, that only gives the instruction "radiooptions 1". But, being new to smartphones and to Android (derivatives), I have no idea on how to make such a script be run at boot, with superuser privileges, without using such proprietary app.
I'm experienced in GNU/Linux and in working with scripts. But, as I said, being new to smartphones (I don't use a cell phone, and only want an iPod Touch equivalent) I know almost nothing about Android/Linux. Nevertheless, being experienced in GNU/Linux, I strongly suspect that there must be a simple way to do this...
So, my question is: Does anyone here know how can one make Replicant run a small script at boot, with superuser privileges, without using the mentioned proprietary app?


Replies (6)

RE: running startup scripts in Replicant - Added by Paul Kocialkowski almost 8 years ago

Having been looking, for a long time, for an alternative to my iPod Touch, where I could have some privacy,

You definitely should be looking into Rockbox then: http://www.rockbox.org/

So, my question is: Does anyone here know how can one make Replicant run a small script at boot, with superuser privileges, without using the mentioned proprietary app?

I think so, I'm not exactly sure how but in any case, there are easier solutions to your problem. You could simply enable airplane mode (that makes a big difference in power consumption already) or just disable the modem totally be removing/moving around the /system/lib/libsamsung-ril.so library (note that /system is read only and you should use adb remount first, see ADB).

RE: running startup scripts in Replicant - Added by Fernando Negro almost 8 years ago

I know of the existence of Rockbox. I have even bought more than one MP4 player to use with it. But, having tried it out, I want more than that. MP4 players are very limited in what they can do - and, usually have bad displays/screens.
When I say that I want an iPod Touch equivalent, I mean that: more than a music player in which I can also play some games, I also want a "pocket computer", with a touchscreen, that I can use to access the Internet, read e-books, occasionally watch some videos, and for possibly everything that a computer like this can be used to. That is, I want a more "powerful" device. ;)
("Airplane mode" is not what I want for my smartphone. Since that, in that mode, the WiFi is also disconnected. I just want to deactivate the modem.)
I will then move the file that you mention.
But, if someone here knows of a more "clean" way to do this, I would very much like to know of it.
Thank you very much for your help, Paul.
And, congratulations for such a great Free Software project. :)

RE: running startup scripts in Replicant - Added by Paul Kocialkowski almost 8 years ago

("Airplane mode" is not what I want for my smartphone. Since that, in that mode, the WiFi is also disconnected. I just want to deactivate the modem.)

As far as I can see on my current device running Replicant, airplane mode does allows Wi-Fi. However, I'm not sure to which extent it prevents tracking, if you worry about that.
Moving the binary is the one reliable way to ensure that the modem is fully off.

But, if someone here knows of a more "clean" way to do this, I would very much like to know of it.

I think airplane mode is the cleanest solution: it uses the only way the Android system has to tell the modem to power itself off (or at least, enter deep sleep and stop emitting). Anything else will either be equivalent to it (radiooptions) or a more or less dirty workaround.

Thank you very much for your help, Paul.
And, congratulations for such a great Free Software project. :)

Cheers! And thanks for your interest in Replicant!

RE: running startup scripts in Replicant - Added by Fernando Negro over 7 years ago

Being new to Android/Replicant, I thought that, if one activated one of the things that the Airplane mode deactivates, the Airplane mode itself would turn off, automatically - since that, it won't be fully on, then. But, I've just tested it, and you're right. One can activate (and use) the WiFi connection and the Airplane mode will continue to be on and leave all the rest of the things deactivated. Nice.

Maybe you're right, about this being a "clean" way to do it. If the Airplane mode is kept during reboots (I've just tested it, and it does) the smartphone is then working in the way I want it to. I just don't know how really deactivated the cell phone radio signal is (if it's just "asleep", as you mention - and, therefore, using a bit of energy because of that - or even emitting some sort of small signal, once in a while - and, therefore, denouncing the smartphone's location). (Being a "citizen journalist" myself, who knows he's under surveillance, I do worry about tracking...)

Anyway, you already told me of another good solution, that it's fully secure, and that I can implement, instead. But, if someone here knows how to make scripts run at boot in Replicant, I would still like to know it very much. :) (Also, for other things that I may want to do, in the future.)

Thank you for such a great Free Software project. :)

It's great to be able to have a smartphone that one can use, for any purpose, where one can trust its operating system - instead of having one running an OS made by a CIA/NSA front company. (http://forums.debian.net/viewtopic.php?f=3&t=117545&start=15#p562937)

RE: running startup scripts in Replicant - Added by Paul Kocialkowski over 7 years ago

Maybe you're right, about this being a "clean" way to do it. If the Airplane mode is kept during reboots (I've just tested it, and it does) the smartphone is then working in the way I want it to. I just don't know how really deactivated the cell phone radio signal is (if it's just "asleep", as you mention - and, therefore, using a bit of energy because of that - or even emitting some sort of small signal, once in a while - and, therefore, denouncing the smartphone's location). (Being a "citizen journalist" myself, who knows he's under surveillance, I do worry about tracking...)

As far as I know, Airplane mode is supposed to cut all transmissions (but the modem is still on and consumes power). Yet, I haven't checked that for sure, so I wouldn't call that a reliable method to ensure the modem is not giving away your position.

Anyway, you already told me of another good solution, that it's fully secure, and that I can implement, instead. But, if someone here knows how to make scripts run at boot in Replicant, I would still like to know it very much. :) (Also, for other things that I may want to do, in the future.)

The other solution (moving the ril binary) should be reliable.

RE: running startup scripts in Replicant - Added by My Self over 7 years ago

You definitely should be looking into Rockbox then: http://www.rockbox.org/

I just wanted to say thanks at this point. I didn't knew this project; but now it runs on my MP3-player...

    (1-6/6)