[DEV accnounce]Gentoo on Android - Android General

Note: I have no priviledge to post on development forums. Hopefully the moderator can move this to "Miscellaneous Android Development" or somewhere better.
Dear all,
Gentoo on Android[1] is a project to run Gentoo natively (non-chrooted) in a directory prefix in parallel to (instead of dual boot) Android.
It grows from a project at Google Summer of Code 2013[2] and at present it provide a fully functional GNU userland to Android devices[3].
There are many Gentoo projects and attempts around the forum and elsewhere, like[4,5,7,8,9,10,11].
Gentoo on Android is unique in that, (1) it sits inside a directory prefix, which makes the installation clean (2) does not use chroot, which allows dynamic library sharing with Android, like libhybris[12].
This is an official subproject of Gentoo[1], seeking to attract efforts of Gentoo development on Android device to coordinate to reduce duplicated work.
At present we support any armv7 devices. A list of devices tested can be found at [6].
To try it out, follow the installation guide on Gentoo wiki.
Cheers,
Benda Xu <heroxbd AT gentoo DOT org>
Footnotes:
1. Project Page https://wiki.gentoo.org/wiki/Project:Android
2. Proposal http://www.awa.tohoku.ac.jp/~benda/projects/android.html
3. Report http://article.gmane.org/gmane.linux.gentoo.summer-of-code/1453
4. GenTop2 http://www.xda-developers.com/android/gentop2-looks-to-replace-webtop-permanently-for-atrix-4g
5. Gentoo on Desire http://forum.xda-developers.com/showthread.php?t=789003
6. Device List https://wiki.gentoo.org/wiki/Project:Android/devices
7. GenTop http://forum.xda-developers.com/showthread.php?t=1403068
8. Gentoo Environment on Android (deprecated by [7]) http://forum.xda-developers.com/showthread.php?t=1147741
9. Gentoo on SGS2 http://forum.xda-developers.com/showthread.php?p=20149547
10. Stock Gentoo on Nexus one.. http://forum.xda-developers.com/showthread.php?t=674063
11. Running Gentoo Linux (as a chroot) on the Motorola Xoom http://klaig.blogspot.jp/2011/05/running-gentoo-linux-as-chroot-on.html
12. Libhybris https://github.com/libhybris/libhybris

Related

[Q] ndk-building does not link stdio properly?

I am working with some large open source projects and some smaller custom C code. I can successfully compile and link these using the ndk-build API even when linking against shared object files within the Android tree. I get functional shared object files and executables for the Android platform. However, it seems that when the applications are built as stand alone (meaning outside the Android source code tree using only ndk-build) the stdio functions do not operate properly. When the same code is placed under external within the Android source code tree and built with Android, the stdio functions work exactly as expected.
I have tried building with ndk r4 and r6, then we tried building with the ndk r4 from within the Android tree. (2.2.1)
the functions in question are
close() - hangs a process when the process is forked
fprintf() - nothing gets written
fopen() for write - the file does not get created as a new file
remove()
unlink()
etc.
I have not tested beyond these functions.
The question is why does the stand alone built code not function properly while the same code built within the Android tree executes properly?
Any insight would be greatly appreciated.
Thanks,
Adam
Edit your post and add a meaningfull thread title.
additional info
Seems in particular that close(0), close(1), and close(2) cause a process hang when fork() is used.
When built with Android code under the external directory, everything works as expected.

[Howto][Android-x86] Mount Internal Windows Partition (NTFS) in Android-x86

Mount Internal Windows Partition (NTFS) in Android-x86.
Android-x86 project is one of the new and exciting offshoot of Android platform solely developed by the community. Our Android community has contributed very heavily for the development of Android as one of the most loved platform for both users and the development community as a whole. Custom ROMs such as CyanogenMod, OmniROM, SlimRom, AOKP, Paranoid Android and many more community developed ROM's rock our beloved devices, including latest flagships to aged Legends such as HTC HD2, Motorola Defy(+). One such community developed Android ROM is the Android-x86 Project.
Android-x86 project aims porting the android experience as whole to the x86 architecture platform. This includes our laptops, desktops and x86 based tablets. Although android is a mobile platform specifically developed for phones, tablets and newly introduced wearable devices such as smart watches and Google Glass eyewear, google has not introduced the android as an operating system into the desktop-laptop segment. Google is sticking with its Chrome OS for desktops and is now trying to introduce android app to the Chrome OS. Android-x86 project patches that gap for us.
Android-x86 is like an elixer for our old desktops and laptops wiith lower capability processors and rams, such as pentium and atoms by introducing a modern OS with a lower requirement. It gives those devices a new life. But it is also not perfect yet and has many drawbacks. One such drawback is that it can't mount the internal NTFS partitions of the HDD, in case of the Multibooting Android-x86 with Windows Operating Systems. Many has tried it before but failed. Recently I came upon a chinese website which depicted a process of mounting internal ntfs partitions using a library named mount_nfsd_fuse.
Steps :
1. Download the mount_nfsd_fuse.zip and extract the file from the download link provided below or here
2. Place the the downloaded file in the /system/xbin/ folder using a root enabled file manaager, eg. ES File Explorer, Root Explorer and and change to approriate permission.
3. Open Terminal ( If no terminal app installed, download one from Google Play), and obtain Su permission.
4. Mount the NTFS partitions using the code for example :
mkdir /storage/D
mount_nfsd_fuse /dev/block/sda2 /storage/D
format : mount_nfsd_fuse /dev/block/(partition) /(mount point)
5. (Optional) You can automate the process of mounting on boot by adding these lines to the /etc/init.sh file.
6. You can make a Windows style My Computer Icon using ES explorer widget pointing to the mounting folder such as in my example /Storage use it as a my computer alternative for android.
NOTE : All internal HDD partitions are stored at /dev/block/ folder. And so far I have failed mounting C drive , sda1, and sda10 partitions. Feel free to poke around.
Disclaimer : I'm note the developer of this tool and i take no responsibility for any damages caused.
Download : http://www.jemshi101.tk/tools/android-x86/mount_nfsd_fuse.zip
Ref : http://tieba.baidu.com/p/2094586835

OnePlus 8 (instantnoodle) - ROM Installer [Linux Only ATM]

instantnoodle-tools-cli-main​Hey all!
I've started this project to allow people to use their devices longer, right now with a focus on the OnePlus 8, but eventually spreading to more devices. These scripts are currently for Linux Ubuntu/Debian distros only, but I plan on expanding support to other systems as well. Below is a link to all the files you will need to start using the scripts for beta testing on Linux machines. The only three ROMs available at the moment are Lineage OS 18.1 (with or without Google), ShapeShift OS v2.6, and Pixel Experience, but, again, more ROMs will be supported. I also plan to include troubleshooting support for frequent issues that can be fixed.
GitHub - kyg203/Android-Tools-CLI-
Contribute to kyg203/Android-Tools-CLI- development by creating an account on GitHub.
github.com
setup.sh - this script installs all of the tools and software for the next scripts to use for flashing. Please initiate this script first time and every week or so to keep tools up-to-date and fresh.
autotools.sh - This is the main script you will be executing. The rest will be executed from here. Do not execute any others manually to ensure you don't break anything.
rom-installer.sh - ROM chooser script. downloads the ROM of your choice and extracts the fastboot images from the payload.bin file. Do not execute from here.
In each ROM folder, there will be an info "readme" file. These files basically serve as a directory listing, allowing you to find the project page on XDA/GitHub/Website, look at any known bugs before you flash, and see any special install instructions. Please check these files regularly!
I will be focusing on perfecting the process on the command line on Ubuntu and Debian based distros first before I begin supporting more distros and operating systems. feel free to leave comments about the project below and begin porting your device into the project!
<---------- WARNING ---------->
// THIS IS STRICTLY IN ALPHA TESTING
// USE AT YOUR OWN RISK AND ALWAYS BACKUP YOUR DATA
<---------- WARNING ---------->
<---------- REQUIREMENTS ---------->
YOUR DEVICE MUST BE BOOTLOADER UNLOCKED
PUT THIS FOLDER IN ROOT (~) aka Home
PATIENCE - This project is still in the process of setting up and may produce errors. Feel free to contact me or anyone on XDA to help you with any issues or answer your questions.
BACKUP YOUR DATA - Backup all of your data even before you unlock your bootlaoder, because as soon as it is unlocked the device is wiped. Be prepared and you have been warned.
<-------------- RECOMMENDATIONS ------------>
I highly recommend you root your phone and leave Lineage Recovery or Pixel Experience Recovery on the device. This generally makes troubleshooting faster and easier. Plus, it allows you to backup your persist.img in the chances it does get corrupted. I will be adding a tool to backup and restore this image for you.
If enough support comes through, I will make a Telegram and Discord for this project specifically for support.
This is a really exciting concept and thank you very much for your efforts thus far.
UPDATE [2020-06-03]
- Added a new folder hierarchy to organize the mess a bit
- The entire project does not create anymore folders inside or outside of the branch
- Trying to leave a small footprint, so deletes all .img's, .bin's, and any other files immediately after usage.
- Updated README (and above)
- Brought support for ShapeShift OS (v2.6 Sceptile)
- Trying out an info file in each ROM folder to highlight features, issues, support, and information. Still working on gathering more information.
Hope everyone is doing well! If anyone has tried it out yet, even an older version, did it work for you and how was the overall process?
Can this be already used or not yet ?
dan20063 said:
Can this be already used or not yet ?
Click to expand...
Click to collapse
Yep! Only works on Ubuntu based systems.
Download the folder, execute setup.sh (as sudo) and then execute autotools.sh (as sudo).
You're "average Linux user" (ik basically a meme at this point) will have no issue installing a ROM manually instead, and would most likely prefer the control and ease of mind of the manual way. Especially because they still need to download and get an understanding of ADB/Fastboot and its commands since that's necessary for unlocking the bootloader.
With that being said I'm glad you made this, looking forward to further development, and I'm downloading now to test and for S&G.
Yeah, that's true. I just wanted to get it going and working on Linux where I'm a bit more comfortable and then switch it to Windows once I have a Windows device. I definitely added a bootloader unlock, but that obviously only works for unlocked devices
Nice work!
Thanks for your time, effort and sharing.
Just updated the autotools project!
What's new?
-- Updated all the available custom ROMs and custom recoveries
-- Shorted a couple of scripts to reduce folder size
-- New backup_persist.sh script - self explanatory. Everytime you run this script, it erases the previous backup, so be careful about executing this one!
-- New restore_persist.sh script - self explanatory - Uses the last made backup of your persist.img!
If you want multiple backups of the persist, maybe for different versions of Android, you will need to go in and rename those files separately. To do this from the terminal, just type "mv persist.img new-name-of-file-here.img" or you can rename the file from your local file manager.
Just a reminder: this project is open source! Please port it to support your own device! I'll be finishing up the OnePlus 8 by this weekend and then working towards my Pixel 6 when it comes in by Christmas.

Boot into Debian or Arch possible on Smartphone? Universal Image for most Devices?

Hello Community!
I am asking myself it is possibe to direkt boot a debian ARM Port or ARCH Linux ARM Port (maybe from SD Card) on my Smartphone? I saw lots of videos booting a Linux on Top of Android but i would like to "natively" run a OS. Where a Custom ROM typically has drivers for a special type of device i am thinking if a very generel distribution could detect most of the devices hardware...
Any Ideas if this would be possible?
AFAIK it's not possible.
Can you give me a (detailled) hint why you think this would not work?
When reading the informations: https://archlinuxarm.org/about/downloads
The released downloads are designed for the specific systems above; however, our package repositories work with any ARM device compatible with ARMv5, ARMv6, ARMv7-a, or ARMv8-a AArch64 instructions.
In TWRP i can select Storage - maybe starting from TWRP command line a image start from SD Card would be possible?
You initially said your goal is to completely replace Android by Linux ( ARCH Linux - what is for tablets only ) on a smartphone, IIRC.
Now you say you want to run Linux ( ARCH Linux ) on top of Android. Confused ...
hello! i meant that my smartphone can start the TWRP bootloader and from there the boot process could be (maybe) handed over to an image at the SD card....
thats the idea... ;-)
TWRP is a Custom Recovery means a restricted Android OS ( like Windows RE for Windows machines), not a bootloader ( what is comparable to UEFI / BIOS on Windows machines ).
The Android bootloader starts the recovery mode and the kernel, which then starts the operating system of your smartphone.

[In Develooment] Kali-linux-touch [In Development]

Q: What is Kali-linux-touch
A: Kali-linux-touch is a rom add-on that will borrow techniques used by Ubuntu Touch for system and hardware integration that will bring full support of Kali-linux to any device that has Lineage-16 and up kernel and device source code
Q: What features will it bring to my device?
A: Hopefully all the pentest features available under Kali-linux in a portable mobile platform to use at your own discretion
But remember with great power comes great responsibilty. Always keep keep the privacy of others in mind and remember that some of the programs tactics tools and techniques used by kali-linux are illegal in most places. Keep that in mind as you build and use kali-linux on your device.
We here at porting_Kali-linux-touch are not responsible for the improper or illegal use of the kali-linux tools.
Always respect the privacy of others!!!
Q: Does your device support Kali-linux-Touch?
A: at this moment no devices are supported and only individuals who want the security of kali-linux are encouraged to participate.
Due to security concerns this project may never have an outright port so its up to the user to build up thier own rootfs to use with the Halium build system and to port your device individually yourself.
On that note please do not post links to your own rootfs or rootfs.img builds as it violates the security and integrity of the system and all individuals who may use it.
Q: How do i get started?
A: You can start by initializing the repo for halium 9 and building a boot image and system image for your device. Every thing after that will require hard work and dedication to understanding how the hardware and software interact so we can bring up a graphical interface to your device.
Q: What special needs are required for my kernel?
A: Quite a few. most kernels will need patches for certain aspects of kali linux to work properly this includes systemd, wifi injection, usb support, bluetooth support and HID support.
The firsr part of integration is all about the kernel and you will want to make sure you have all the needed kernel configs to make sure the final product is up to par with all the features kali linux offers
Q: What works and where is the most attention needed to get Kali-linux-working?
A: Right now we need help in getting the rootfs prepared correctly with the proper configs and packages to get it to work with an android touch based system. This includes integrating the hardware and software into the rootfs and bringing up a graphical ui
Q: where can i get the rootfs needed to start working on porting to my device?
A: The first thing to think about when it comes to Kali-linux is security security security. It would be foolish for me to post a link for a rootfs and even more foolish for any one to download and try to use that rootfs.
Because of what kali is and what can be done with it, the rootfs has been under constant attack by black hat hackers over the years with the intention of fooling people into downloading a rootfs that they have patched themselves to steal data and secure information from you.
Because of that intent you should always download your rootfs from a trusted reliable source and as for this project build it up yourself for use with the halium system to insure your own safety and security
this group will serve as a guide as to how to best build up your own rootfs in order to create a rootfs.img to use as your port.
you can find the group on telegram here:
Kali Mobile
group dedicated to bringing a full version of Kali-linux to android devices
t.me

Categories

Resources