Replace android with linux

Replacing Android OS on Android phone with Linux OS

I’d like to entirely replace Android on my phone, which I plan to eventually root. I’ve learned so far that Linux Deploy can be used to run a full Linux distro alongside the Android OS, but really I want to replace Android OS. I’m willing to put Mobian (mobian-project.org) on there or just pure Debian. Is this possible yet in 2021?

2 Answers 2

Reason : Hardware drivers are proprietary Building them without the source is extremely difficult Requires a lot of expertise and time Not possible unless you have low level access to your device hardware (Meaning being able to flash without fastboot or edl)

So yeah stick to the answer that, NO you can’t replace Android entirely with Linux.

You can of course try using other AOSP based OS like Lineage OS which are build on AOSP so it is compatible with the default kernel for you device (This is also only possible if it is already built for your device)

If you want to run Linux alongside Linux there are a few ways.

Like you said you can use Linux Deploy. (I have personally not used this)

Or you can use PRoot with Termux which is a user-space implementation of chroot thus you can a virtualized Linux environment (similar too using chroot) but without the need of a rooted device. You can either use PRoot with scripts created by others via AnLinux or Andronix.

Or you could always learn how it works and manually set it up :>

And no as time goes on things wont change. You won’t be able to install Linux in a Android device. This is not due to hardware incapability but rather it is how the Smartphone industry works.

Источник

Replacing android with linux arm

Все действия Вы выполняете на свой страх и риск.

Я использовал

Часть 1: Подготовка

Дальнейшие действия необходимо проделывать на Android устройстве 2. Создаем файл для будущего образа с помощью make_ext4fs. Если у вас есть отдельный раздел на карте памяти — желательно использовать его. В моем случае 16Гб SD карта была забита важными данными и возможности сдвинуть главный FAT раздел не было. В зависимости от настроек /sdcard может быть как внешней, так и внутренней картой памяти.

3221225472 это 1024*1024*1024*3, следовательно будет создан образ в 3Гб. Размер образа определите для себя по вкусу. Помните что на FAT32 нельзя создать файл больше 4Гб 3. Примонтируем образ и распакуем файлы ArchLinux ARM 4. Несмотря на то, что наша цель — обойтись без chroot, для базовой настройки и проверки работоспособности chroot все же нужно сделать. В противном случае обновлять, доставлять пакеты Вам придется уже на боевой системе.

Читайте также:  Настройка сетевых папок линукс

Часть 2: Поиск и решение проблем

Проблема 1: ping не работает

Вспоминаем, что у Android серьезная система разграничения прав. И в нем существует пермишен на «Полный доступ к сети». Без этого пермишшена пользователи не могут получить полный доступ к сокетам. То что надо. Вернемся к Android консоли и пропишем комманду id: У вас вывод может быть другой Но вот незадача, chroot не обновляет group. Поможет вот такой «хак»:

Проблема 2: Не работает DNS

Если Вы запороли PATH

Если произошло такое, что простые комманды вида ls,cat,su не работают(не видятся) системой, Вы можете попробывать вызвать их напрямую: /system/bin/ls, /system/bin/cat, /system/xbin/su.
Или перезагрузить устройство.

Ставим необходимые пакеты

Проверяем gcc

Часть 3: Подготовка к работе без chroot

Самое главное, что позволяет ArchLinux работать без chroot рядом с андроидом — тот факт, что папки и файлы ArchLinux и андроид различны и не мешают друг другу. Если Вы не уверены в том, что файлы не пересекутся, выполните эти команды из Android консоли: Покажет пересечение файлов. У меня это выглядит так: Выполним копирование файлов из /etc/ в /arch/etc/ из Android: Ключ -a обязателен, так как при использовании обычного -R права скопированы не будут.

Нужно заранее позаботится о Root.

Android приложения требуют, что бы комманда su сразу же давала доступ к суперпользователю и не запрашивала пароль.

Часть 4: Поехали!

Создадим нужные каталоги и воспользуемся mount —bind что бы виртуально заменить директорию, не изменяя ее на диске. Если что-то сделано неправильно, Вы можете перезагрузить устройство и попробовать снова. Порядок монтирования важен. При ошибке с монтированием стандартные команды могут взятся из ArchLinux до того, как все каталоги будут смонтированы.

Что дальше

В итоге мы имеем практически полноценный ArchLinux за исключением systemd с свежими версиями пакетов. Можно установить http, php, mysql. При правильной настройке на уменьшение потребления памяти даже на моем смартфоне с ОЗУ 512Мб они работали корректно. Можно установить иксовые библиотеки и с помощью X сервера для Android пользоваться ПО для линукса. xterm заработал корректно. Можно собирать любые программы (и, о нет, ядра) для Linux без ПК.
Можно установить Java для ARM и использовать Java приложения.

Послесловие

Большой проблемой остается systemd и его привязка к PID 1. Для того, что бы сохранить PID 1 нужно влезть в init андроида и прописать exec после инициализации устройств. Это можно сделать заменив init андроида shell скриптом, но тогда остается вопрос что делать с оригинальным init андроида. Так как место на загрузочном диске ограничено несколькими мегабайтами, нужно будет использовать switch_root в заранее созданный образ. Мне пока не удалось завести systemd таким способом. Мне 16, и это моя первая публикация. Конструктивная критика приветствуется. Источник

Replacing android with linux arm

Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

Читайте также:  What is named pipes in linux

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux — A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author’s experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free.

So I saw attempts to emulate Linux on Android, using a special console application on rooted phones. What I’ve been pondering on doing (in case such would be stable and functional) is switching my Android device to Linux. In other words, completely removing Android and installing a Linux distribution with ARM support. I’d like to know if at this day, such a thing is possible and safe to do. What I’m really trying to achieve is being able to use PC Linux and software on my (originally) Android smartphone. Of course, the programs that can be compiled for ARM processors. I don’t truly want my smartphone to be a phone, but more like a hand laptop, where I can use the same software as my PC whenever possible. Since I’m a KDE fan, I’m looking for a distribution that uses KDE and Plasma Active. Although smartphones have small screens, I still wish to use KWin (or the appropriate window manager) and have windows, a launcher (such as kickoff launcher), a login manager with usernames. but of course all adapted for touchscreen manipulation.

Obviously, I still use it as a phone as well and need to make calls, send and receive SMS messages, take photos and movies with the camera, etc. So the Linux distribution would need to have packages for all those things. Also the ability to use the SIM card to its fullest and everything else. Not sure if Linux distributions for ARM include all mobile phone functionality, which is the other thing I’d like to know. In short: Is it possible to entirely replace Android with Linux on a smartphone and tablet? Also, will such Linux distributions allow me to still use all features of the smartphone, except Samsung’s proprietary stuff like Smart Stay? Any tutorials on how this is done also? «Is it possible to entirely replace Android with Linux on a smartphone and tablet? « Yes is mostly correct. That would assume a number of things so most can not easily be changed. There are web sites devoted to this change and many a broken phone has been made. Dumb DCMA may even make this illegal if you can imagine that. Since you ask this, I’d have to suggest that you don’t attempt this on a good or needed phone. So I saw attempts to emulate Linux on Android, using a special console application on rooted phones. What I’ve been pondering on doing (in case such would be stable and functional) is switching my Android device to Linux. In other words, completely removing Android and installing a Linux distribution with ARM support. I’d like to know if at this day, such a thing is possible and safe to do. What I’m really trying to achieve is being able to use PC Linux and software on my (originally) Android smartphone. Of course, the programs that can be compiled for ARM processors. I don’t truly want my smartphone to be a phone, but more like a hand laptop, where I can use the same software as my PC whenever possible.

Читайте также:  Linux установка графической оболочки debian

Since I’m a KDE fan, I’m looking for a distribution that uses KDE and Plasma Active. Although smartphones have small screens, I still wish to use KWin (or the appropriate window manager) and have windows, a launcher (such as kickoff launcher), a login manager with usernames. but of course all adapted for touchscreen manipulation. Obviously, I still use it as a phone as well and need to make calls, send and receive SMS messages, take photos and movies with the camera, etc. So the Linux distribution would need to have packages for all those things. Also the ability to use the SIM card to its fullest and everything else. Not sure if Linux distributions for ARM include all mobile phone functionality, which is the other thing I’d like to know. In short: Is it possible to entirely replace Android with Linux on a smartphone and tablet? Also, will such Linux distributions allow me to still use all features of the smartphone, except Samsung’s proprietary stuff like Smart Stay? Any tutorials on how this is done also? I would say no. Usually the firmware bit is extremely difficult to get working with anything else than the original system. you will therefore end up missing lots of hardware features!
If you are a kernel and firmware expert, then yes, it is possible. Debian has an armel and arm version of its distro. Plasma active should be possible to install on Debian Arm. If you manage to do it, please send me a private message on the forum, I would be very interested in doing the same! Plasma active looks far more interesting than all the poor desktop environments on todays tablets and smartphones. Ooh, and don’t expect to get UMTS or GSM installed, both those are proprietary (industry secret). If you do, then you are brilliant.

Источник

Оцените статью
Adblock
detector