I'm undertaking a stupid project and would like to ask some questions of some more experienced developers. Yes I know there's no practical reason for this, and no you cannot talk me out of it.
I would like to create a sort of "super nerd" adaptation of CyanogenMod for command line Linux junkies, or at least for Comp Sci grad students like myself. I want my phone to be able to recompile and reinstall nearly everything it runs. Yes I know that's a painful and slow operation: I did "emerge tightvnc" on a chroot Gentoo install and the command took about 18 hours. I remain undeterred.
Questions:
Sun JDK is apparently not available for arm7a. Am I reading the docs correctly, and one can indeed use Apache Ant to compile Android? Or is Ant not what I think it is? I'm not opposed to creating a small Bochs VM that boots, mounts a network filesystem, executes some JDK task, and then signals to terminate. I'd rather not if I can help it though.
How much access does the radio hardware get to the rest of the system? If I were to store something personal in an encrypted loopback partition, could someone abuse direct memory access to read from memory without the host OS knowing about it?
Has anyone played with adapting the Android boot process to use System V type init scripts? I'd like to make it easy for Tasker to say "we're running out of memory -- go from init level 5 to something arbitrary, say 7, which stops some services. Oops, still low, go init level 8, which disables more services.
I definitely plan on sharing my work. What do you guys think of the name CyanoGentoo?
Thanks all.
Apparently Apache Ant is not what I thought it is.
How about this then: does anyone know where I might find a community for people interested in general purpose computing on an Android phone?
Michael Spencer said:
Apparently Apache Ant is not what I thought it is.
How about this then: does anyone know where I might find a community for people interested in general purpose computing on an Android phone?
Click to expand...
Click to collapse
Don't know if you're still around but I'm very interested in helping and believe I may already have some solutions for you. If you're still running chroot or another form of ARM Linux distro (Debian based is what I'm coding for at the moment) then check my github
https://github.com/S0AndS0/Debian-Kit-Mods
The readme file has directions on how to clone and run the main modding script which curently has at least one if not two options that'll peek your interest for sure.
One set of options will download and install Java's JDK (either hard float or soft float) and another will download and install jMonkey (a user friendly programing SDK built on eclips) which will get you one step closer to compiling things on an Android device for Android devices. However, I've yet to crack running "Android SDK" because they have yet to reliece an ARM compatible source and "wine" (a Linux package for emulating other CPU's) is still under heavy development, so building Android from source and such is still out of the scope of what I've been able to script up for easy use.
On a side note; a quick google search of my user name and the key words guide, linux, jdk, arm and xda will result in links of what I've written up on enteracting with Linux on Android if you get stuck anywhere.
And if you search "raspberry pi android adb similar:xda" you'll find what I'll likely be working on bringing to Android; after debugging the script I'm working on to set up a Brendle (one of many methods of "cloud computing" availible for ARM) node/network through all availible network interfaces (bluetooth, 3G/4G, wifi) on Android.
Sent from my SPH-D700 using xda app-developers app
I am still around, and when I get a chance I'll take a look. I think I'm mostly satisfied with AIDE and chroot Ubuntu.
And those worried about dma exploits via radio hardware need only use a wifi-only device with a portable hotspot, I've concluded. No way to prevent these exploits otherwise.
Thanks again.
Michael Spencer said:
I am still around, and when I get a chance I'll take a look. I think I'm mostly satisfied with AIDE and chroot Ubuntu.
And those worried about dma exploits via radio hardware need only use a wifi-only device with a portable hotspot, I've concluded. No way to prevent these exploits otherwise.
Thanks again.
Click to expand...
Click to collapse
Indeed AIDE has been a fantastic tool for me as well.
Heh dma was indeed a concern of mine among other security issues with running Linux over 3/4G but its to bad there's no solution yet. I'm using old phones and tablets for most tests but try as I might I can't break into them from out side my hotspot network... even though I can connect to the divice running the hotspot remotely if it is running Linux too.
hmm, I'm working on a new script of examples for networking now, lots of building blocks to my latest project, which may help new scripters with some networking tedium of finding and assigning specific IP's to variables so they can be shared or saved or modified into other commands quickly. This will upon compleation will be one of the references for other scripts I'm working on for getting openstack and MPI running on multiple devices swiftly.
Speaking of MPI; the installer for Bramble on Android now works (install option 2 within for Debian Kit users) for getting that software package installed and all that is left to work on is the setup for machine files and sshkeys for multi-node quick set-up.
Two questions; seeing as how you have AIDE, perhaps you might be able to help with my other project that I'm working on? I've another github repo where I'm working to incorporate a; soft/hard float Linux installer, terminal emulator, rdp/vnc client, scripter, and forwarding of Linux GUI to a second device and/or Chromecast of a specific desktop or Linux window with x11... Currently stuck on the terminal but still very new to Java for Android.
or because that's a bit much to ask; perhaps some help with Android scripting for installing Linux on Android that uses Debian Kit's methods to provide hard float or soft float?
I'll be around and have modified my sig for easier tracking and will be pushing more updates to github today, hopefully by the end of the day have a sshkey passer script for quickly setting up passwordless remote login. After that will be some work on setting up bridges between USB, Bluetooth, Wifi, and any other network interface available for faster transfer of large data sets.
Edit 03192014
Michael Spencer said:
Has anyone played with adapting the Android boot process to use System V type init scripts? I'd like to make it easy for Tasker to say "we're running out of memory -- go from init level 5 to something arbitrary, say 7, which stops some services. Oops, still low, go init level 8, which disables more services.
Click to expand...
Click to collapse
Check out the Debian Kit app, from what I have found it exposes all of the Linux processes and file system to Android and if running as root user on Linux then the full Android file system is exposed too. Debian Kit doesn't use chroot to run Linux so it's "possible" to run a chroot environment at the same time. And running "ps" commands on Android or Linux terminals, produce nearly identical output, of both Linux and Android processes happily running meaning that if Tasker can't see these processes then a script can run the "ps" command and run a command to shut down Linux processes; likely it's a bit more complex because re-starting those services or even suspending some could cause un-wanted behavior. Still though with testing and time it is possible to have the memory better managed.
Update 03312014- Back on making your phone compile itself subject; I'm working on using(/scripting an installer for) OpenStack on Android, which has QEMU for emulating CPU processors which will eventually allow us to install Android SDK on Android(s) running Linux. I'm using OpenStack because to emulate a normal PC processor one even a quad core ARM processor is really slow (use to be an app for this called Limbo PC emulator but last I searched the market place this app was gone) so using OpenStack will allow us to throw what ever extra Android phones into a pool of sharable CPU power; essentially I'll be creating a 7 or 8 (virtual) core processor out of networked Android phones and then emulate a 2 or 4 core x86 processor within and install the tool kits for android that have CPU requirements.
I've other plans for OpenStack too but those will require that I incorporate mesh networking and google translate. So that users anywhere can build a cloud of shared processing power.
Sent from: SPH-D700 or myTouch3Gs or Sero 7 Pro
Linux Install guide for Android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Or
https://docs.google.com/document/d/1ssVeIhdBuuy8CtpBP1lWgUkG6fR6oHxP20ToYPPw6zI/edit?usp=drive_web
And my script pack for installing; Java's JDK, node.js and more to your Linux OS
https://github.com/S0AndS0/Debian-Kit-Mods
Note: if you're new to Linux/scripting/command line; check readme file for instructions.
http://www.timelesssky.com/blog/building-android-sdk-build-tools-aapt-for-debian-arm
http://www.timelesssky.com/blog/develop-app-on-android-with-android-sdk
Hey all found the ^answer^ if you've not already found this blog then you all are in for a treat dig around on that above site and you'll find some other really cool stuff for Linux Android systems.
Sent from: SPH-D700 or myTouch3Gs or Sero 7 Pro
Linux Install guide for Android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Or
https://docs.google.com/document/d/1ssVeIhdBuuy8CtpBP1lWgUkG6fR6oHxP20ToYPPw6zI/edit?usp=drive_web
And my script pack for installing; Java's JDK, node.js and more to your Linux OS
https://github.com/S0AndS0/Debian-Kit-Mods
Note: if you're new to Linux/scripting/command line; check readme file for instructions.
Inspired by the recent post on the headlines describing how to enable Android Messages For Web by fiddling with some settings, I took and consolidated what I learned there, plus some other testing, into a handy-dandy Magisk Module that *should* work to enable MFW.
*HOWEVER*, I'm doing something wrong, and need a bit of help.
Repo is here:
https://github.com/d8ahazard/Magisk_Messages_For_Web
Basically, I'm just copying the sqlite binary to system, and then firing the commands to update some bools in a preference DB, then force-closing the messaging app so they take effect.
But for some reason, the script doesn't appear to be running. I'm trying to fire it in the services section. I can see that the bit where I'm setting permissions on sqlite3 is working, but I don't know why the sql commands aren't being executed.
Is there some way to output directly to the Magisk log from a module/script? I think if I can see what's happening there, I'd be set.
If I execute the service script manually in shell, it works:
Code:
marlin:/magisk/AMW # ./service.sh
Enabling Android Messages for Web (Hopefully)
Executing command '"UPDATE Flags SET boolVal=1 WHERE packageName LIKE '%messaging%' AND name LIKE '%PhenotypeOverrideRollout%'"'
Command status is 0
Executing command 'UPDATE Flags SET boolVal=1 WHERE packageName LIKE '%messaging%' AND name LIKE '%bugle_phenotype__enable_multi_device%';'
Command status is 0
Executing command 'UPDATE Flags SET boolVal=1 WHERE packageName LIKE '%com.google.android.apps.messaging%' AND name LIKE '%MultiQueueRollout__launched__%';'
Command status is 0
Executing command 'UPDATE Flags SET boolVal=1 WHERE packageName LIKE '%com.google.android.apps.messaging%' AND name LIKE '%MultiDeviceRollout__launched__%';'
Command status is 0
Records updated successfully!
Restarting messaging app
I know I'm close...I just don't know what's missing!
Interested by the purpose.
It would be great if you had material redesign :
https://www.xda-developers.com/android-messages-enable-material-redesign/
... When it will work !
julienbdx said:
Interested by the purpose.
It would be great if you had material redesign :
https://www.xda-developers.com/android-messages-enable-material-redesign/
... When it will work !
Click to expand...
Click to collapse
Yeah, that is literally just adding one more line to my script, and would more than likely make the material redesign permanent.
At least, modifying the settings needed for MFW in db versus the phenotype.xml preferent makes MFW permanent. I'd assume the issue described in the theme thread is the exact same thing.
All I need is for someone to explain to me why the damned services.sh script isn't executing. I've even tried putting the commands in post-fs script instead...same thing. I add a line at the very end to 'touch /sdcard/hasMFW' so I know the script ran, but no 'hasMFW' file every shows up in /sdcard.
Someone...anybody...help?
@topjohnwu
julienbdx said:
Interested by the purpose.
It would be great if you had material redesign :
https://www.xda-developers.com/android-messages-enable-material-redesign/
... When it will work !
Click to expand...
Click to collapse
There, I've pushed to git a version that has the commands that *should* enable material design as well.
Also, tried moving to post-fs.sh, still nothing works...
https://github.com/d8ahazard/Magisk_Messages_For_Web/commit/10319c338943d8b77b8c8523f31cc276bc4e5d23
Just FYI,
Modifying the flags table in PhenoType.db under GMS isn't permanent either (certainly better than a Shared_Prefs edit). It gets reset still. We're still trying to understand what causes it to reset.
MishaalRahman said:
Just FYI,
Modifying the flags table in PhenoType.db under GMS isn't permanent either (certainly better than a Shared_Prefs edit). It gets reset still. We're still trying to understand what causes it to reset.
Click to expand...
Click to collapse
That's good to know.
Ideally, if this would fire properly as a service, functionality would then be restored on reboot.
However, from what I'm seeing in my tests on my Pixel XL, with the values set the way I've done - I've not seen any breakage in functionality - even over numerous reboots.
digitalhigh said:
That's good to know.
Ideally, if this would fire properly as a service, functionality would then be restored on reboot.
However, from what I'm seeing in my tests on my Pixel XL, with the values set the way I've done - I've not seen any breakage in functionality - even over numerous reboots.
Click to expand...
Click to collapse
Yes, we've tested it too. It'll survive multiple reboots and FCs but eventually it reverts. We've narrowed it down to a service in GMS that checks every 24 hours.
MishaalRahman said:
Yes, we've tested it too. It'll survive multiple reboots and FCs but eventually it reverts. We've narrowed it down to a service in GMS that checks every 24 hours.
Click to expand...
Click to collapse
Interesting. What's the service name called? I've been poking around in the APK itself...
What I'm noticing is that my wife and a friend of mine both have Pixel 2 devices, and they "just have" the feature...which isn't all that surprising.
So, I'm wondering if the service is checking device props and enabling the feature that way. If so, then Magisk would again be an ideal candidate for fixing that issue.
LMK the service name, I'm no stranger to reversing smali.
Hello,
I want to use Linux on my Galaxy Tab S8+ through Termux and proot distro (Arch, actually).
However, no matter what I do, there's no way to make GPU work on it...
Using the last Termux from github + Termux-X11, I managed to launch xfce4 desktop on my Arch proot, but when I try glxgears, I get:
Error: couldn't get an RGB, Double-buffered visual
Click to expand...
Click to collapse
glxinfo:
Error: couldn't find RGB GLX visual or fbconfig
Click to expand...
Click to collapse
Blender:
intern/ghost/intern/GHOST_WindowX11.cpp:136: X11 glXQueryVersion() failed, verify working openGL system! initial window could not find the GLX extension Writing: /tmp/blender.crash.txt Segmentation fault
Click to expand...
Click to collapse
I do have compiled mesa on Arch with freedreno-KGSL enabled and zink.
My final goal is to make Blender work with GPU while using proot (no chroot because I don't want to root it yet and loose warranty).
Unfortunately, due to this issue: https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , you're going to need to root if you want to run Linux desktop apps on ANY Android 12 device.
Once you root your Tab S8, install Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy), run it and install whichever distro you like (I chose Kali), and Remote Desktop Manager (https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager) to connect to it via VNC
The only settings I had to change in Linux Deploy was changing the installation type to Directory and the installation path to
Code:
${ENV_DIR}/rootfs/linux
, but your mileage may vary depending on what distro you want to install. If you want to use your Android filesystem from Linux, enable mounts and mount /data/media/0 to /mnt/android.
I haven't messed with PulseAudio, because I really just wanted full LibreOffice. Let me know if you get it to work. You may also want to go into GUI settings in Linux deploy and change the resolution to 1920x1200, but again it depends on your distro chosen.
But keep in mind, rooting will 1. Brick your KNOX chip permanent 2. Without KNOX chip, apps like secret folder, samsung pass and few more will stop working. 3. To root you need to unlock the bootloader which triggers the knox chip and permanently disables it and it cannot be recovered or enabled again since knox chip has a tiny fuse inside itself so when bootloader is unlocked it will burn the thin copper thread inside fuse and snap off that will permanently disable knox and this would also void your warranty when knox chip gets triggered and disabled.
So take time think about it before doing it. Do you want warranty or not? Do you want to lose those apps that you may want to use later or already using?
Thanks for your answers.
I know that root and bootloader will break the waranty and is not recoverable. It's why I'm trying to make it work using proot.
skrowl said:
Once you root your Tab S8, install Linux Deploy (https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy), run it and install whichever distro you like (I chose Kali), and Remote Desktop Manager (https://play.google.com/store/apps/details?id=com.devolutions.remotedesktopmanager) to connect to it via VNC
Click to expand...
Click to collapse
I use termux-x11 or termux-wayland rather than VNC because it's more fast and smooth.
The GPU seem to work from termux itself (tried glxgears on openbox). However, it doesn't work from proot-distro.
After some research, I found that I could use the GPU by compiling virglrenderer with egl enabled, and then, export GALLIUM_DRIVER=virpipe from proot-distro.
However, to compile virglrenderer, I need to compile mesa from source with gbm enabled, but the compilation give me errors :
../src/vulkan/wsi/wsi_common_display.c:1238:4: error: implicit declaration of function 'pthread_setcanceltype' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); ^
../src/vulkan/wsi/wsi_common_display.c:1238:4: note: did you mean 'pthread_setname_np'? /data/data/com.termux/files/usr/include/pthread.h:352:5: note: 'pthread_setname_np' declared here int pthread_setname_np(pthread_t __pthread, const char* __name); ^
../src/vulkan/wsi/wsi_common_display.c:1238:26: error: use of undeclared identifier 'PTHREAD_CANCEL_ASYNCHRONOUS' pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); ^
../src/vulkan/wsi/wsi_common_display.c:1268:7: error: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_cancel(wsi->wait_thread); ^
../src/vulkan/wsi/wsi_common_display.c:1268:7: note: did you mean 'pthread_once'? /data/data/com.termux/files/usr/include/pthread.h:275:5: note: 'pthread_once' declared here int pthread_once(pthread_once_t* __once, void (*__init_routine)(void)); ^
../src/vulkan/wsi/wsi_common_display.c:2183:10: error: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pthread_cancel(wsi->hotplug_thread);
Click to expand...
Click to collapse
I found out that pthread_cancel is not supported in the android libc.
Now, I don't know what to do...
Here's the Termux discussion about it here: https://github.com/termux/termux-app/issues/2366
Trust me that I spent a lot of time looking into it and there are no workarounds. You MUST root to use Linux in Android 12, period. Termux is no longer viable for background processes (like an X server), but you can still use it to do stuff interactively (working directly in your shell with Termux never losing focus). Your background processes will eventually get murdered by the OS and your X session will just suddenly go poof. It's sad too, because I really liked Termux.
skrowl said:
Here's the Termux discussion about it here: https://github.com/termux/termux-app/issues/2366
Trust me that I spent a lot of time looking into it and there are no workarounds. You MUST root to use Linux in Android 12, period. Termux is no longer viable for background processes (like an X server), but you can still use it to do stuff interactively (working directly in your shell with Termux never losing focus). Your background processes will eventually get murdered by the OS and your X session will just suddenly go poof. It's sad too, because I really liked Termux.
Click to expand...
Click to collapse
Just tried, and yeah, you right...
I though "acquire wakelock" would fix that, but I never used Linux though X11 more than 5 seconds...
Why do the OS ever do that?
You should just probably wait until you've had your tab s8 long enough that you're satisfied it won't need to be returned and are willing to void the warranty by rooting it. Come back to playing around with linux then. Until then, just install linux in a VM on one of your computers and VNC into it with your tablet.
skrowl said:
You should just probably wait until you've had your tab s8 long enough that you're satisfied it won't need to be returned and are willing to void the warranty by rooting it. Come back to playing around with linux then. Until then, just install linux in a VM on one of your computers and VNC into it with your tablet.
Click to expand...
Click to collapse
Wait... Even with root, termux-x11 will still not work, won't it? It's a problem from android 12 itself.
I don't want to use VNC since it's too slow.
shim80 said:
Wait... Even with root, termux-x11 will still not work, won't it? It's a problem from android 12 itself.
I don't want to use VNC since it's too slow.
Click to expand...
Click to collapse
Check https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , they talk about commands you can run (as root) to disable the phantom process killing, which would allow termux to run. That said, termux's proot is MUCH MUCH slower than real chroot.
On localhost, you're very unlikely to be able to tell a difference between old school x11 and vnc. Wayland improves it somewhat, but it's probably still a very negligible difference on a local machine.
skrowl said:
Check https://gist.github.com/agnostic-ap...#how-to-disable-the-phantom-processes-killing , they talk about commands you can run (as root) to disable the phantom process killing, which would allow termux to run. That said, termux's proot is MUCH MUCH slower than real chroot.
On localhost, you're very unlikely to be able to tell a difference between old school x11 and vnc. Wayland improves it somewhat, but it's probably still a very negligible difference on a local machine.
Click to expand...
Click to collapse
You can execute this via adb btw
Can anyone explain to us, newbies in Linux , who can't understand what is the difference between x11, Wayland, vnc. If we root the tablet, will Linux work fast, or it will work somehow like we run it in an emulator?
What is the best/fastest approach. If we do the fastest method, how slower will it work compared with, if it could work Linux internal as default os. Just an estimation. Because I'm thinking if I'll root it to install Linux.
Thanks,
Checkout my gameplay with termux :
Guan Yu said:
Checkout my gameplay with termux :
Click to expand...
Click to collapse
What device are you using?
shim80 said:
What device are you using?
Click to expand...
Click to collapse
Redmi Note 11
sosimple said:
Can anyone explain to us, newbies in Linux , who can't understand what is the difference between x11, Wayland, vnc. If we root the tablet, will Linux work fast, or it will work somehow like we run it in an emulator?
What is the best/fastest approach. If we do the fastest method, how slower will it work compared with, if it could work Linux internal as default os. Just an estimation. Because I'm thinking if I'll root it to install Linux.
Thanks,
Click to expand...
Click to collapse
If you are entirely new to Linux, you probably should not be doing this yet. If you need a comparison as to why I'm stating this, here is one that is probably not as good: it is similar to trying to do a professional figure skating move that they do in the Olympics while you are still learning how to just balance without falling.
In other words, learn more about Linux and also get used to using Linux on a normal desktop / laptop computer before trying to do such stuff on your mobile device.
CtrlAltCuteness said:
If you are entirely new to Linux, you probably should not be doing this yet. If you need a comparison as to why I'm stating this, here is one that is probably not as good: it is similar to trying to do a professional figure skating move that they do in the Olympics while you are still learning how to just balance without falling.
In other words, learn more about Linux and also get used to using Linux on a normal desktop / laptop computer before trying to do such stuff on your mobile device.
Click to expand...
Click to collapse
Thanks for the reply, but it actually isn't a reply as it doesn't explaining what i ask. What are the differences of all those. I have linux in my pc, although i don't use it much as i can use windows there. If Linux in tab s8 ultra is working very good, i might use it here as i can't use windows.
skrowl said:
... I really just wanted full LibreOffice.
Click to expand...
Click to collapse
Why not just use the LibreOffice release for Android?
Renate said:
Why not just use the LibreOffice release for Android?
Click to expand...
Click to collapse
There isn't. You probably mean colabora office. It's not very good..
LibreOffice for Android and iOS | LibreOffice - Free Office Suite - Based on OpenOffice - Compatible with Microsoft
www.libreoffice.org
sosimple said:
There isn't. You probably mean colabora office. It's not very good..
Click to expand...
Click to collapse
Yeah, I was misled by the Wikipedia article. I did see that the Colabora stuff.
I don't use portable devices for anything productive.
At the most I'll use them with a BT keyboard to capture raw typing that will later get corrected/converted/used on a desktop.
shim80 said:
Hello,
I want to use Linux on my Galaxy Tab S8+ through Termux and proot distro (Arch, actually).
(...)
Click to expand...
Click to collapse
If you are still interested in Linux (for example, Ubuntu) on a smartphone, then take a look at the thread full of inspiration.
[GUIDE][NO-ROOT] How to install Ubuntu and other Linux Distros on Your Phone or Android TV Box, using Termux
NOTICE: THIS METHOD IS ONLY FOR NON ROOTED DEVICES PROOT-DISTRO GITHUB PAGE Hello Friends! Today I wanted to start a thread that will house prebuilt Linux environments, as well as instructions for building the Linux environments yourself...
forum.xda-developers.com