[LINUX] Gentoo on your Desire (tutorial) - Desire Android Development

Gentoo on HTC Desire
Prerequisites:
Rooted Desire
Any flavour of Linux (Live or installed)
Code:
A decent sized MicroSD card (>2Gb recommended)
MicroSD USB adapter (or SD card reader and adapter)
Some knowledge of Linux command line and Gentoo is recommended
Patience...
Things you should know first:
This is NOT a fully independent Linux - it runs parallel to Android inside a chroot environment
Some applications can be very slow until they are compiled properly for the Desire hardware
Compilation with a 1GHz single core CPU is slow
You can run just about any Linux program; X programs and desktop environments can be used via VNC
Many custom ROMs and kernels do not include swap support for performance reasons, and so if you require swap you may need to compile your own kernel (I will upload my custom kernel at a later date)
Due to Android security settings, only root can use the network. This causes some problems as anything that requires network access must run as root (again, if anyone has any insight for a way around this, please contact me)
Some ROMs underclock the CPU when the screen is off - this will lead to VERY long compilation times if you leave your phone like that
Step one - Prepare MicroSD
To install Gentoo you will need an ext2, 3, or 4 filesystem on your MicroSD card. This can be done two ways: partitioning your card (recommended), or by creating a file and creating the filesystem within that (not covered here).
Start up GParted (or something similar) on your computer and insert your MicroSD card; if your card is fully allocated, you will need to shrink the existing partition(s) first (back up your data! This can go wrong...) and leave a space at the end of the card for your new partition. The absolute minimum I would recommend to dedicate to Gentoo would be 1GB, but that doesn’t give you much wiggle room and you will have a very hard time compiling anything big (like GCC); I would recommend making the partition >2GB. Make sure you create the Gentoo partition at the end of the card.
Note:
APP2SD+ requires its own partition - if you have it enabled, you must have at least three partitions, with the second partition on the card dedicated to it and the third for Gentoo.
Due to the large number of files in the Portage tree, small partitions can sometimes run out of inodes. You can get around this by decreasing the size of the inodes and blocks, and therefore creating more:
Code:
~ $ sudo mkfs.ext3 /dev/(partition) -i 2048 -b 2048
Step two - install base system:
Download the latest stage 3 tarball for armv7a-unknown-linux-gnueabi from the Gentoo mirror closest to you (Google "Gentoo Mirrors", I can't post links yet..), mount the Gentoo partition and extract the contents of the tarball to it.
Example:
Code:
~ $ wget (your selected mirror)/linux/gentoo/releases/arm/autobuilds/current-stage3/armv7a-unknown-linux-gnueabi/stage3-armv7a-20100917.tar.bz2
~ $ sudo mkdir /mnt/sd
~ $ sudo mount /dev/(partition) /mnt/sd
~ $ sudo tar xjvfp stage3-armv7a-20100917.tar.bz2 -C /mnt/sd/
Download the latest portage snapshot (from the Gentoo mirror) and extract:
Code:
~ $ wget (your selected mirror)/linux/gentoo/snapshots/portage-latest.tar.bz2
~ $ sudo tar xjvf portage-latest.tar.bz2 -C /mnt/sd/usr/
Now modify the make.conf file using your favourite text editor:
Code:
~ $ sudo nano /mnt/sd/etc/make.conf
Sample make.conf:
Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2" # if anyone has any suggestions to improving these, please let me know
CXXFLAGS=${CFLAGS}
CHOST="armv7a-unknown-linux-gnueabi"
USE="unicode X -gnome -kde -firefox wifi syslog -udev -mdev -wifi -gpm threads nptl networking wxwidgets -ipv6 sqlite jpeg png dbus" # Have a look at the Gentoo USE flag description page on the web for others you may want/don't want
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
SYNC="rsync://(your selected mirror)"
GENTOO_MIRRORS="(your selected mirror)"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
PORTAGE_NICENESS="19"
AUTOCLEAN="yes"
FEATURES="noman nodoc noinfo -userfetch" # Getting rid of the man, doc and info pages saves a lot of space. Userfetch is disabled due to the issue described above
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog" # Again, this saves some space
Edit locale.gen with the locale values you require, e.g.:
Code:
en_US.UTF-8 UTF-8
Unmount your MicroSD card and insert it back into your phone.
Step three - configuring the base system
Using ConnectBot, another terminal emulator app, or adb, connect to the local console and setup the mounts, then enter Gentoo (using busybox as your shell (type "busybox sh") is recommended as the tab completion (trackball + i in connectbot) helps a lot):
Code:
# mkdir /data/gentoo
# mount -t ext3 (or whatever fs you set it to) /dev/block/mmcblk0p3 (change the 3 to whatever partition you need) /data/gentoo
# mount -t proc none /data/gentoo/proc
# mount -o bind /dev /data/gentoo/dev
# mount -t devpts none /dev/pts
# chroot /data/gentoo /bin/bash
# source /etc/profile
Congratulations! You are now inside your own Gentoo environment. If you don't need your phone for a while you can now recompile and update the system (this will take quite a long time and will use a lot of data). This doesn't have to be done now, or at all, but it is highly recommended to do so at some point:
Code:
# emerge -DuNav world
Once that's done (or you don't want to do it), install some base programs:
Code:
# emerge -av screen sudo
If you want VNC, tightvnc is recommended:
Code:
# emege -av tightvnc
Web server:
Code:
#emerge -av nginx
Set a root password:
Code:
# passwd
For some reason running SSHD with IPv6 enabled causes the phone to restart. To fix this, make the following changes to /etc/ssh/sshd_config:
Change:
Code:
#AddressFamily any
To:
Code:
AddressFamily inet
To start SSHD:
Code:
# ssh-keygen -t rsa (save to /etc/ssh/ssh_host_rsa_key with no passkey)
# ssh-keygen -t dsa (save to /etc/ssh/ssh_host_dsa_key with no passkey)
# /usr/sbin/sshd
If your kernel supports swap, it is recommended to create and enable it:
Code:
# dd if=/dev/zero of=/swap bs=10M count=20 (change this to alter the size of the swap file)
# mkswap /swap
# swapon /swap (you will need to run this command with the other mount commands each time you boot)
Boot script:
Start your phone in recovery mode and mount /system using the partitions menu in your recovery ROM, then create a file on your computer with the following contents:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="Android"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p3"
SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX} # Edit -t as required by your filesystem
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} /bin/mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sd
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
Connect your phone and computer with the USB cable, then use the following command on your computer:
Code:
~ $ adb push (File you created earlier) /system/etc/init.d/05linux
~ $ adb shell chmod 755 /system/etc/init.d/05linux
Now reboot your phone and your Gentoo partition should automatically mount.
Notes:
If you restart your phone, you will need to issue the necessary mount commands as you did earlier until I (or someone else) get around to making a proper script that runs at boot time
For information on how to set up programs and servers on Gentoo visit the Gentoo wiki
Please contact me or post here with any questions you may have regarding this
Changelog:
Updated CFLAGS and bootscript
Thanks to sfjuocekr for his/her contributions.

Thanks for this tutorial, Gentoo is my favourite Linux distro and it's great to know someone's got it running on the Desire
I don't think I've got the patience to try it on my phone though, all the compiling must take ages. I wonder whether it's possible to cross-compile...

F****ING AWESOME DUDE!
go to try in today =)
gentoo rulez!

koider said:
Thanks for this tutorial, Gentoo is my favourite Linux distro and it's great to know someone's got it running on the Desire
I don't think I've got the patience to try it on my phone though, all the compiling must take ages. I wonder whether it's possible to cross-compile...
Click to expand...
Click to collapse
DistCC
http://distcc.samba.org/

I have the same issue with openssh-server crashing my Nexus One (running Ubuntu 10.04 on CM6) too. I would love to figure out how to fix it.

Restored OP to state before server crashes - changed CFLAGS and added a boot script.
EDIT: I have solved the mystery of the SSHD crash!! It's to do with IPv6 - OP updated.

Deathisfatal said:
Restored OP to state before server crashes - changed CFLAGS and added a boot script.
EDIT: I have solved the mystery of the SSHD crash!! It's to do with IPv6 - OP updated.
Click to expand...
Click to collapse
Sweet. That solved my problem with sshd on chrooted Ubuntu on CM6 on my Nexus One! Thanks!

You should do a emerge -e world to recompile the whole tree after first boot.
This will make sure all your packages are compiled with correct CFLAGS etc.

Please delete me!
Solution found myself.

Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="armv7a-unknown-linux-gnueabi"
USE="minimal unicode -X -gnome -kde -firefox -wifi syslog -udev -mdev threads nptl -ipv6 sqlite jpeg png dbus -gpm ssh"
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
FEATURES="noman nodoc noinfo -userfetch"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog"
AUTOCLEAN="yes"
LINGUAS="en"
PORTAGE_NICENESS="19"
I use this make.conf for Gentoo on my Desire.
Firstly NEVER globally allow keywords, this is bad. Do this for the specific programs you need, you can use /etc/portage and mask/unmask packages you actually need unmasked.
Set MAKEOPTS to -j1 instead of 2, helps keeping the system usable while emerging together with PORTAGE_NICENESS at 19.
I have left X etc all out of the global USE flags to save space, again use /etc/portage to set specific USE flags for packages that need them. This will save alot of space, because there are lots of packages with X support you will never need usualy.
I'm not entirely sure about leaving wifi and mdev away, but wifi is handled by Android itself and mdev should be too.
Then in the startup-script there was a minor mistake bind mounting /dev/fd, this is the modified script:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="UGH-GSM"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p2"
#SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX}
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
#${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${CHROOT} /bin/mkdir /mnt/data
${CHROOT} /bin/mkdir /mnt/sdcard
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sdcard
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
And yea some error handling should be added to check if a directory exists yes or no, but not really important.
If I make more changes, I'll make notice here in the forums. If you have other general Gentoo questions, please ask I have been working with Gentoo since 2001 But it is a really trial and error distribution, you HAVE to be self capable to fix problems that will arise ... they WILL arise
And again, leave
ACCEPT_KEYWORDS="~arm ~*" # Many useful packages are masked for arm with ~*
out of your makefile. Do it in /etc/portage when needed.
Don't use -O3 and -Os together, this actually GROWS ... same with using mcpu with march doesn't work just use march and mtune. -O2 is recommended.
http://www.gentoo.org/doc/en/gcc-optimization.xml

Also make sure you emerge linux-headers first so it ends up in world.
Usualy emerging a kernel makes sure headers are in place, but in this chrooted enviroment it isn't and might be cleaned with depclean or revdep-rebuild. Not sure why tho, because it should be in system already :s

This is a very interesting development! Thanks to everyone who made it possible.
Has anyone so far been able to run an Xserver / WM / DE yet?
Would love to see some screenshots of this in action..

sfjuocekr said:
Code:
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
CHOST="armv7a-unknown-linux-gnueabi"
USE="minimal unicode -X -gnome -kde -firefox -wifi syslog -udev -mdev threads nptl -ipv6 sqlite jpeg png dbus -gpm ssh"
VIDEO_CARDS="none"
ALSA_CARDS="none"
INPUT_DEVICES="none"
ACCEPT_LICENSE="*"
MAKEOPTS="-j1"
FEATURES="noman nodoc noinfo -userfetch"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude ChangeLog"
AUTOCLEAN="yes"
LINGUAS="en"
PORTAGE_NICENESS="19"
I use this make.conf for Gentoo on my Desire.
Firstly NEVER globally allow keywords, this is bad. Do this for the specific programs you need, you can use /etc/portage and mask/unmask packages you actually need unmasked.
Set MAKEOPTS to -j1 instead of 2, helps keeping the system usable while emerging together with PORTAGE_NICENESS at 19.
I have left X etc all out of the global USE flags to save space, again use /etc/portage to set specific USE flags for packages that need them. This will save alot of space, because there are lots of packages with X support you will never need usualy.
I'm not entirely sure about leaving wifi and mdev away, but wifi is handled by Android itself and mdev should be too.
Then in the startup-script there was a minor mistake bind mounting /dev/fd, this is the modified script:
Code:
#!/system/bin/sh
#
# Linux startup script for rooted Android systems
# © Deathisfatal @ forum.xda-developers.com
#
# TODO:
# - Error handling
#
# Edit the following variables as required
HOSTNAME="UGH-GSM"
LINUX="/data/gentoo/"
BB="/system/xbin/busybox"
CHROOT="${BB} chroot ${LINUX}"
ROOT="/dev/block/mmcblk0p2"
#SWAP="/swap"
${BB} mount -o noatime -t ext3 ${ROOT} ${LINUX}
${BB} mount -o bind /dev ${LINUX}dev
${CHROOT} /bin/mkdir /dev/shm
${CHROOT} /bin/mount -t tmpfs -o size=32m none /dev/shm
${CHROOT} /bin/mkdir /dev/fd
${BB} mount -o bind /proc/self/fd /dev/fd
${CHROOT} /bin/mount -t devpts none /dev/pts
${BB} mount -t proc none ${LINUX}proc
#${CHROOT} /sbin/swapon ${SWAP}
${CHROOT} /bin/mount -t tmpfs -o size=32m none /tmp
${CHROOT} /bin/mkdir /tmp/run
${CHROOT} /bin/mkdir /tmp/run/portage
${CHROOT} /bin/touch /tmp/run/utmp
${CHROOT} /bin/chmod 777 -R /tmp
${CHROOT} /bin/mkdir /mnt/data
${CHROOT} /bin/mkdir /mnt/sdcard
${BB} mount -o bind /data ${LINUX}mnt/data
${BB} mount -o bind /sdcard ${LINUX}mnt/sdcard
${CHROOT} /bin/hostname ${HOSTNAME}
# Uncomment the following line to enable sshd on boot
#${CHROOT} /usr/sbin/sshd
And yea some error handling should be added to check if a directory exists yes or no, but not really important.
If I make more changes, I'll make notice here in the forums. If you have other general Gentoo questions, please ask I have been working with Gentoo since 2001 But it is a really trial and error distribution, you HAVE to be self capable to fix problems that will arise ... they WILL arise
And again, leave
ACCEPT_KEYWORDS="~arm ~*" # Many useful packages are masked for arm with ~*
out of your makefile. Do it in /etc/portage when needed.
Don't use -O3 and -Os together, this actually GROWS ... same with using mcpu with march doesn't work just use march and mtune. -O2 is recommended.
http://www.gentoo.org/doc/en/gcc-optimization.xml
Click to expand...
Click to collapse
Thanks very much for your insight! I'll change the tutorial with your suggestions when I'm at a computer later on.
I originally just had -Os for optimization but someone suggested using it with -O3, but their post got lost with the server crash. I've only been using Gentoo for a year now so I'll bow to your wisdom!
I have tightvnc setup along with openbox, so I'll post a couple of screenshots later on too.
EDIT: Is there any benefit to having -mfpu=neon? Or is vfpv3 superior?
Sent from my HTC Desire using XDA App

I'm currently working on getting Gentoo running natively with the S-OFF hack. At the moment I have it booting up, connecting to wifi and starting sshd, but X is a hassle. If anyone wants to collaborate on the project send me a message or post here; any help would be greatly appreciated!

Respect!
Deathisfatal said:
I'm currently working on getting Gentoo running natively with the S-OFF hack. At the moment I have it booting up, connecting to wifi and starting sshd, but X is a hassle. If anyone wants to collaborate on the project send me a message or post here; any help would be greatly appreciated!
Click to expand...
Click to collapse
Massive project! I'm impressed.
I wish I had any skill to be able to support you.

Deathisfatal said:
Thanks very much for your insight! I'll change the tutorial with your suggestions when I'm at a computer later on.
I originally just had -Os for optimization but someone suggested using it with -O3, but their post got lost with the server crash. I've only been using Gentoo for a year now so I'll bow to your wisdom!
I have tightvnc setup along with openbox, so I'll post a couple of screenshots later on too.
EDIT: Is there any benefit to having -mfpu=neon? Or is vfpv3 superior?
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Don't know for sure. I could try compile against neon to see if there is a speed increase. But to my knowledge neon instructions are already used or might only be use with vfpf3-d32.
Once I get my own box up and running again, I'll try it out. Compiling GCC without DISTCC is a horror!

Sorry about the lack of updates to the thread - I've been pretty busy at uni lately. I'm currently having a lot of issues with X11 segfaulting randomly so I'll post pictures once I have that back up and running. When X decides to work, the whole interface works nicely - touch support via tslib is great, and fbdev seems adequate for 2D graphics.
Has anyone had any success with the tutorial I posted?
If anyone's interested, to get Gentoo running natively you need to compile your own kernel with a few changes:
Disable ramdisk support
Enable swap (optional)
Create a boot script that mounts FS's, proc, etc
Disable Android paranoid networking so users other than root can access the net
Then start your phone in fastboot, push your modified kernel to your phone with fastboot with "root=/dev/mmcblk0p3 (or mmcblk0p2) init=(your boot script) rootfs=ext3 rootwait" as the kernel command line.
When I have time I will create a full guide for getting Linux and X running.
Massive project! I'm impressed.
I wish I had any skill to be able to support you.
Click to expand...
Click to collapse
Thanks!
sfjuocekr said:
Once I get my own box up and running again, I'll try it out. Compiling GCC without DISTCC is a horror!
Click to expand...
Click to collapse
Indeed! I left GCC 4.5 compiling for 6 hours, only for it to run out of space and fail...

ANd on v6 CPU?
Thanks for the tutorial, Deathisfatal. I thought this was a great idea, so decided to try it on my HTC Hero (as opposed to Desire).
On the first try, the
chroot /data/gentoo /bin/bash
command failed with an "illegal instruction" error. I figured my processor must be an earlier one in the ARM family than the one for which the bash in the stage 3 tarball had been compiled (v7-a). Sure enough, when I looked in /proc/cpuinfo, the processor turned out to be a v6 - the first line of cpuinfo says
ARMv6-compatible processor rev2 (v6l)
So, I tried again using stage3-armv6j-20101112.tar.bz2 instead of stage3-armv7a-20101114.tar.bz2. This improved things a bit. I could then run the bash shell in the chrooted environment, and cd and ls around the chrooted filesystem.
Unfortunately, attempting to run emerge still failed with an "illegal instruction" error (so did attempting to run tar or wget). At this point, I'm stuck. I guess I still have a stage 3 for the wrong processor variant (and that at some point I'll also have to fiddle with the -march and -mtune options in CFLAGS), but have no idea how to select the right stage 3.
Advice welcome, thanks.

That's quite strange! Perhaps try the armv5tel stage3 tarball. It could be that the armv6 stage3 is compiled for a different FPU than what the Hero has. What does the features line say in /proc/cpuinfo?

Deathisfatal said:
That's quite strange! Perhaps try the armv5tel stage3 tarball. It could be that the armv6 stage3 is compiled for a different FPU than what the Hero has. What does the features line say in /proc/cpuinfo?
Click to expand...
Click to collapse
Thanks. I'll give v5tel a go.
The features line says
swp half thumb fastmult edsp java

Related

Getting a wider set of development tools on the phone

So, I've been playing around with QuickSSHd and one thing I noticed is there aren't many tools available in the shell. I put an arm build of Fedora on the phone, and now I have access to strace, gdb, gcc, etc..
I figured I'd post my steps here in case anyone else is interested.
1) First thing I did was root the phone with the Unrevoked app.
2) Then I bought a 16 gb microsd card so I wouldn't have to split the 8gb card that came with the phone
3) I partitioned the new card on my linux box using fdisk. I did two partitions, the first a FAT partition and the second a linux one. It was something like:
# fdisk /dev/sdb
d 1
n
p
1
t
c
n
p
2
w
# /sbin/mkfs.vfat /dev/sdb1
# /sbin/mkfs.ext3 /dev/sdb2
4) One that was done, i mounted the ext3 partition and grabbed this prebuilt fedora chroot tarball:
ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f12.tar.bz2
and untarred it into a directory i called "fedora" on the ext3 partition.
5) I then turned off my phone, pulled out the battery and swapped the existing sdcard with my newly formatted one, put the phone back together and booted it up. It took a long time to boot after this and in the notification panel it said it was "preparing the sdcard"
6) Then i started QuickSSHd back up and ssh'd to the machine as root
7) next i ran "busybox sh" to get a better shell than whatever was started before
8) then I created a shell script called f12.sh that looked like this:
--8<----------
#!/bin/sh
cd $HOME
mkdir -p mnt/fedora
mkdir -p dev
ln -sf /dev/block/vold/179\:2 dev/sdcard2
grep -q dev/sdcard2 /proc/mounts || mount dev/sdcard2 mnt/fedora
grep -q rootfs-f12/dev /proc/mounts || mount --bind /dev mnt/fedora/rootfs-f12/dev
grep -q rootfs-f12/sys /proc/mounts || mount --bind /sys mnt/fedora/rootfs-f12/sys
grep -q rootfs-f12/proc /proc/mounts || mount --bind /proc mnt/fedora/rootfs-f12/proc
grep -q rootfs-f12/tmp /proc/mounts || mount -ttmpfs tmpfs mnt/fedora/rootfs-f12/tmp
mkdir -p mnt/fedora/rootfs-f12/mnt/system
mkdir -p mnt/fedora/rootfs-f12/mnt/data
grep -q rootfs-f12/mnt/system /proc/mounts || mount --bind /system mnt/fedora/rootfs-f12/mnt/system
grep -q rootfs-f12/mnt/data /proc/mounts || mount --bind /system mnt/fedora/rootfs-f12/mnt/data
mkdir -p mnt/fedora/rootfs-f12/debug
grep -q rootfs-f12/debug /proc/mounts || mount -tdebugfs debugfs mnt/fedora/rootfs-f12/debug
export LD_LIBRARY_PATH=`pwd`/mnt/fedora/rootfs-f12/lib:`pwd`/mnt/fedora/rootfs-f12/usr/lib
export HOME=/root
cd mnt/fedora/rootfs-f12
lib/ld-linux.so.3 usr/sbin/chroot . bin/bash --login
------>8---------------------
I used vi for this, you could use cat > f12.sh instead.
One weird part of this is the /dev/block/vold/179\:2 symlink. The busybox version of mount apparently can't grok source devices with colons in them. The symlink is just to rename it to something that mount can understand. I imagine the 179 part varies from system to system.
9) Then i ran sh f12.sh which put me in a fedora chroot.
10) I notice the rpm database is a little screwy in the chroot so I ran
# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb
11) At this point I could yum:
# yum -y install strace gdb screen gcc vim-enhanced powertop
Some useful things:
- The kernel debug filesystem is in /debug
- Parts of the phone OS are available in /mnt/data and /mnt/system
Attached is an updated f12.sh (minor tweaks made as I've noticed issues come up)
wow, this is quite interesting!
i might venture into giving this a try.
two pieces of information, only as an FYI, i make no claim to whether or not these are better than the method you provide, only an alternate method which might or might not be better. perhaps a combination of methods would be best? i'll leave it up to the end user to decide.
1) some of those binaries you mention, like strace are already provided by the userdebug PC36IMG.zip (root part 1) in system/xbin from HTC. if anybody wants these binaries, they can be extracted from the system.img inside of the .zip file using unyaffs. if requested, i can post.
2) android open source project, which contains all the source files for android, provides dropbear has a compact arm compiled ssh client.
thanks for taking the time to test all this out and posting up the detailed step by step along with your .sh file!!!

[Q] spending lots of time with segmentation fault error (chroot)

spending lots of time with segmentation fault error (chroot)
I success to open up ubuntu GUI on my android
with following site
(first googled site with "cyanogenmod ubuntu")
but fail with other imgs(such as img in nexusonehack)
for now, I am trying to bootup ubuntu 10.10 on my gw620(smart phone whose cpu is ARMv6 Qualcomm MSM7200)
by my self.
with selfmade rootstock img and busybox and chroot
I made img my self withroot stock with following option
rootstock -f kty1104-Notebook -l kty1104 -p 1 --imagesize 2047M --notarball --seed linux-image-omap,lxde,build-essential,openssh-server,tightvncserver,x11-xserver-utils
and change name to ubuntu.img and place to /sdcard/
and apply to bootubuntu.sh
bootubuntu.sh contents is this
===============================================
#!/system/bin/sh
# Original script by Paolo Sammicheli xdatap1
#
# Based on Saurik's remount.sh modified version by Mark Walker of
# URL is here but I can't write url b/c of my account privilege
# Modified version for Cyanogenmod by potoc samdroid
mkdir /mnt/ubuntu
#remount system as read/write
remount rw
export mnt=/mnt/ubuntu
export PATH=/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export kit=/sdcard
export loopdev=/dev/block/loop4
losetup $loopdev $kit/ubuntu.img
mount -t ext2 $loopdev $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
cat $mnt/root/logo.txt
echo " "
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean umount!"
echo " "
echo "Please reboot your device when you finished your work."
chroot $mnt /bin/bash
busybox umount -f /mnt/ubuntu/dev/pts /mnt/ubuntu/proc /mnt/ubuntu/sys /mnt/ubuntu
===============================================
do I need more option for rootstock?
or do I need special sh file for it?
I can mount ubuntu.img with
# mknod -m640 /dev/loop0 b 7 8
losetup /dev/loop0 /sdcard/ubuntu.img
mount -t ext2 /dev/loop0 /mnt/ubuntu
but when it comes to chroot, it sprit [1] segmentation fault chroot ${mnt} /b...#
if there are missing information please let me know, I will write it down
Regards.
Taeyun
I know I musn't revive old threads... but the question and the problem is already set up here.
I'm having the same problem with my HTC Magic 32A. Anybody knows what's up with the segfault?
Thanks!
I've spent a lot of time on this issue too, and as far as I can tell it's because Ubuntu versions over 9.04 (jerking jackalope or whatever idiot name they use) no longer support ARMv6. This means I can't run BT5, which is based on 10.x, but I believe Debian still supports v6.

[Guide] Installing Debian on Android 4.2

Requirements:
An ARMv7 chipset (with VPFv3 if using armhf arch)
Loopback kernel support (if using img file as per this guide, otherwise could use dedicated partition on sdcard).
Rooted device
Busybox
Preparing an image:
On a linux machine setup filesystem for mounting on the android device, below I create a 2GB loopback image.
Code:
# dd if=/dev/zero of=wheezy-armhf.img bs=1M count=0 seek=2048
# mkfs.ext4 -F wheezy-armhf.img
# mount -o loop wheezy-armhf.img /debian
Now we populate the filesystem with the files to complete the debian installation.
Code:
# debootstrap --arch=armhf --variant=minbase --foreign wheezy /debian $DEBIANURL
# umount /debian
Complete installation:
Now on the android device we complete the debian installation.
Code:
# mount -o rw,remount rootfs /
# export LINUXROOT=/linux
# mkdir $LINUXROOT
# busybox mknod /dev/block/loop100 b 7 100
# losetup /dev/block/loop100 /path/to/wheezy-armhf.img
# mount -t ext4 /dev/block/loop100 $LINUXROOT
# busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
# mount -t proc none $LINUXROOT/proc
# mount -t sysfs none $LINUXROOT/sys
# mount -o bind /dev $LINUXROOT/dev
# mount -t devpts none $LINUXROOT/dev/pts
Now you can setup any other mounts you want, for example I bind mount my external USB storage etc. Now to login to the debian environment and install ssh server:
Code:
# export TMPDIR=/tmp
# export USER=root
# export HOME=/root
# export SHELL=/bin/bash
# export TERM=linux
# export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin
# export LC_ALL=C
# export LANGUAGE=C
# export LANG=C
# busybox chroot $LINUXROOT /bin/bash
We are now inside debian envrionment and perform some first time setup:
Code:
# passwd root
# groupadd -g 3001 aid_net_bt_admin
# groupadd -g 3002 aid_net_bt
# groupadd -g 3003 aid_inet
# groupadd -g 3004 aid_net_raw
# groupadd -g 3005 aid_net_admin
# groupadd -g 3006 aid_net_bw_stats
# groupadd -g 3007 aid_net_bw_acct
# groupadd -g 3008 aid_net_bt_stack
# echo "deb $DEBIANURL wheezy main" >/etc/apt/sources.list
# apt-get update
# apt-get install openssh-server
# exit
# sync
Now have a SSH service running that allows to login via ssh. Note that if you wish to use networking for other user accounts add them to the aid_inet and aid_net_raw groups. For example for transmission I did:
Code:
# apt-get install transmission-daemon
# usermod -a -G aid_inet,aid_net_raw debian-transmission
# invoke-rc.d transmission-daemon restart
chroot: can't change root directory to '/debootstrap/debootstrap': No such file or di
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Pickout said:
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Click to expand...
Click to collapse
I have that same problem. Any solution by now?
Thanks.
m
mickmattes said:
I have that same problem. Any solution by now?
Thanks.
m
Click to expand...
Click to collapse
I'll look into it, but it sounds like it has not bootstrapped the image correctly.
Pickout said:
Hi!
First, thanks for your guide, the only one I've seen for Android 4.2
So I have a nexus 4 on Android 4.3 with Paranoid Android custom ROM and rooted with busybox 1.21 JB bionic (included with the ROM). I've done all the steps above until chroot, which gave me an error:
Code:
[email protected]:/ # busybox chroot $LINUXROOT /debootstrap/debootstrap --second-stage
[COLOR="red"]E: No pkgdetails available; either install perl, or build pkgdetails.c from source[/COLOR]
1|[email protected]:/ #
So what now? how do I install Perl for android? Do I have to install microperl from busybox's site?
Please help me, I'm trying to install Debian for 4 days.
Click to expand...
Click to collapse
No you don't need to install Perl. Something as gone wrong with one of the steps. I'll see what I can figure out. Are you using the armhf arch? Cause I could send you a premade image to see if that has any success for you.
Thanks for your help, I've finally found what's the problem (two weeks ago, I've forgotten this thread), but thanks!
(The problem was that the environment variables were not set up properly)
Thanks to these links, I've managed to install Debian 7 on a rooted Android phone. All credit goes to them:
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_%3A_Chroot_Debian (in french)
http://forum.xda-developers.com/showthread.php?p=45457799
http://forum.xda-developers.com/showthread.php?t=2312013
http://forum.xda-developers.com/showthread.php?t=631389
http://forum.xda-developers.com/showthread.php?t=1418546
http://forum.xda-developers.com/showpost.php?p=5671794&postcount=124
VNC
________________
I. On the PC
So first, you have to create the .img file that will contain the OS.
In a GNU/Linux environment (PC) and with the root permissions, type these commands:
Code:
# mkdir debian
# dd if=/dev/zero of=wheezy-armhf.img bs=1M count=0 seek=2048
[COLOR="Red"](NOTE: "of=" will be the name of our .img file and "seek=" the size of the file (MB). Here, we create a file named "wheezy-armhf.img" of 2 GB)[/COLOR]
# mkfs.ext4 -F wheezy-armhf.img
# mount -o loop wheezy-armhf.img /debian
Then we have to fill up the filesystem.
Code:
# debootstrap --foreign --arch=armhf wheezy debian/
# umount debian
Finally, move it to your SD Card. In my case, I moved it on /data/local/
II. On the phone
On your phone, in a terminal emulator and with the root permissions, type the following commands:
Code:
# mount -o rw,remount rootfs /
# export LINUXROOT=/linux
(NOTE: here we'll install Debian on the root of the internal memory, in "/", but we can also install Debian on the SD Card or in /data/loca/linux by changing the path after "LINUXROOT=")
# mkdir $LINUXROOT
# busybox mknod /dev/block/loop100 b 7 100
# losetup /dev/block/loop100 /sdcard/wheezy-armhf.img
# mount -t ext4 /dev/block/loop100 $LINUXROOT
# chroot $LINUXROOT /bin/sh
# export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# /debootstrap/debootstrap --second-stage
The debootstrap's second part should start. Grab a cup of coffee while it's working!
When it's finish, leave the chroot by typing
Code:
# exit
# su
Let's mount the filesystem. We're close!
Code:
# mount -t proc none /proc
# mount -t sysfs none /sys
# mount -o bind /dev /dev
# mount -t devpts none /dev/pts
Now, we have to set the environment variable. Ensure that you have set the correct path of LINUXROOT in case you've chosen another path than /linux.
Code:
# export LINUXROOT=/linux
# export TMPDIR=/tmp
# export USER=root
# export HOME=/root
# export SHELL=/bin/bash
# export TERM=linux
# export LC_ALL=C
# export LANGUAGE=C
# export LANG=C
And finally, chroot.
Code:
# chroot $LINUXROOT /bin/bash
su
Welcome on Debian!
III. DNS and Mirrors
Set a DNS. We'll set the free Google DNS but you can set yours if you want.
Code:
echo -e "domain local\nsearch local\n" >> /etc/resolv.conf
echo -e "# DNS Google\nnameserver 8.8.8.8\nnameserver 8.8.4.4\n" >> /etc/resolv.conf
You can add mirrors to your sources.list if you want. For my case, I'm french so I added french mirrors:
Code:
# echo -e "## Debian Wheezy sources.list\n\n" > /etc/apt/sources.list
# echo -e "## Debian.org FR mirror\ndeb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free\ndeb-src http://ftp.fr.debian.org/debian/ wheezy main contrib non-free\n\n" >> /etc/apt/sources.list
# echo -e "## Debian security updates\ndeb http://security.debian.org/ wheezy/updates main contrib non-free\ndeb-src http://security.debian.org/ wheezy/updates main contrib non-free\n >> /etc/apt/sources.list
IV. VNC
To access your Debian in a graphical environment from your PC or your phone, you have to set up a VNC Server and install a Desktop Environment. Let's install VNC and LXDE.
We'll follow the steps described on the LXDE wiki:
Code:
su
# apt-get update
# apt-get install lxde
# apt-get install tightvncserver
Set up the VNC server by typing the following command, which will ask you to set two passwords (let the second password if you want):
Code:
# vncserver
Kill the session:
Code:
# vncserver -kill :1
Go to /root/.vnc/ and edit the xstartup file: comment out #/etc/X11/xsession and add these two lines:
icewm
lxsession
Click to expand...
Click to collapse
To start a VNC session, type "vncserver -geometry <HEIGHT>x<WIDTH>". For the Nexus 4, we would type "vncserver -geometry 1184x768"
To access your Desktop Environment from your phone, download android-vnc-viewer and launch it.
In the password field, type your password. In the address field, type "127.0.0.1", in port type "5901" and select 24-bit color (4bpp).
V. Script
I've made three scripts to mount, launch and unmount Debian. Whenever you reboot your phone, you'll have to mount Debian, set the environment variables and chroot.
VI. Credit
All credit goes to them:
http://linux-expert.net/?Trucs_et_astuces___Android___Tutoriel_%3A_Chroot_Debian (in french)
http://forum.xda-developers.com/showthread.php?t=2312013
http://forum.xda-developers.com/showthread.php?t=631389
http://forum.xda-developers.com/showthread.php?t=1418546
http://forum.xda-developers.com/showpost.php?p=5671794&postcount=124
VNC
Sorry for my bad english
Thanks for your work and solution. However I did not try it yet, because I'm trying to do it with the following solution. Perhaps I'll do this one next weekend
http://whiteboard.ping.se/Android/Debian
I really like the idea of it.
Just have a look.
P.S: By the way, I'm running Pacman-Rom (4.3) and it seems to work, if you flash googy-Kernel or some other Kernel. CM-Kernel has
some kind of SElinux restriction, which prevents you from changing the debian root password.
Wow, it sounds amazing! I will sure give it a try next week too.
Thanks for the link!
Pickout said:
Wow, it sounds amazing! I will sure give it a try next week too.
Thanks for the link!
Click to expand...
Click to collapse
I got stuck in a bootloop after flashing. I'm quite sure, that I did everything correctly...
I think my Pacman-Rom (JB 4.3) is to blame.
Thanks for the guide, was looking for something like this. I tried it first on an SD card formatted to ext4 (wanted a larger than 4GB .img file) but it failed to work. Went back to fat32 and for now kept a 4GB .img and after following you guide, it worked perfectly.
Where can I find the img ?
Hello,
Thanks for this how too!!
But where can I find the img ? wheezy-armhf.img ?
Thanks for your help,
Cheers,
Mat
matthieuDroid said:
Hello,
Thanks for this how too!!
But where can I find the img ? wheezy-armhf.img ?
Thanks for your help,
Cheers,
Mat
Click to expand...
Click to collapse
you make it yourself: the dd-command in the beginning creates a file called wheezy-armhf.img and fills it with zeros.
need enlightenment
hello,
i'm follow the instruction but get stuck with
# chroot $LINUXROOT /bin/sh
chroot: can't execute 'bin/sh': No such file or directory
Click to expand...
Click to collapse
pls help
i'm using galaxy note 3 n900 with armv7

[ARMv7/Intel][Root][Busybox][init.d]Optware-ng: install pre-compiled native packages

This how-to describes how to bootstrap and configure Optware-ng. Optware-ng is my Optware firmware-independent fork. This allows to install numerous pre-compiled packages.
Lists of available packages can be found here:
ARMv7 hardfloat
Intel
ARMv7 softfloat
And the project home is currently here:
https://github.com/alllexx88/Optware-ng
Some packages may not work, since not all of them are compatible with android, but most will. There're some pre-requisites you must satisfy before you can proceed:
1. You must be rooted
2. Optware-ng relies on some standard linux commands, the easiest way to make sure you have them is to install Busybox with all the links
3. We'll create Optware-ng initialization script in /system/etc/init.d, so init.d support is needed. If you don't have it, you can either add it (google for how-tos on doing this) or edit your init.rc android startup script to include Optware-ng initialization lines (though adding init.d support is still a better idea)
The following commands should be issued from terminal as root. I suggest you use some SSH server available on the Play Store, and connect via SSH from you PC.
1. This prepares needed environment:
- Optware-ng will be installed to /data/Optware-ng with /opt symlinked to it
- Optware-ng scripts rely on /bin/sh, so we symlink it to /system/bin/sh
- Optware-ng needs /tmp temp dir: we create 64Mb RAM disk there (you may adjust the size if you like)
Code:
mkdir -p /data/Optware-ng
mount -o remount,rw /
ln -s /data/Optware-ng /opt
mkdir /bin
ln -s /system/bin/sh /bin/sh
mkdir /tmp
chmod 777 /tmp
mount -t tmpfs -o size=64M tmpfs /tmp
mount -o remount,ro /
export PATH=$PATH:/opt/bin:/opt/sbin
2. This bootstraps the feed:
2.a) for ARMv7 hardfloat (most modern android devices):
Code:
cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-armeabihf/buildroot-armeabihf-bootstrap.sh
sh buildroot-armeabihf-bootstrap.sh
2.b) for Intel:
Code:
cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-i686/buildroot-i686-bootstrap.sh
sh buildroot-i686-bootstrap.sh
2.c) for the unlikely case where your device is ARMv7, but lacks FPU (softfloat feed):
Code:
cd /tmp
wget http://optware-ng.zyxmon.org/buildroot-armeabi-ng/buildroot-armeabi-ng-bootstrap.sh
sh buildroot-armeabi-ng-bootstrap.sh
Unless you're using ARMv7 softfloat feed, bootstrapping process may appear to be "stuck" on this:
Configuring glibc-locale
Generating locale-archive with default locales ...
Click to expand...
Click to collapse
Don't be frightened: if your device isn't too powerful, it indeed takes a lot of time, but you have to do this just once, so please be patient.
3. Make sure environment needed for Optware-ng is restored after reboots, and also run Optware-ng startup scripts on boot:
Create init.d startup script and make it executable
Code:
mount -o remount,rw /system
echo '#!/system/bin/sh
mount -o remount,rw /
ln -s /data/Optware-ng /opt
mkdir /bin
ln -s /system/bin/sh /bin/sh
mkdir /tmp
chmod 777 /tmp
mount -t tmpfs -o size=64M tmpfs /tmp
mount -o remount,ro /
sleep 2
export PATH=$PATH:/bin:/opt/bin:/opt/sbin
for script in `ls /opt/etc/init.d/S*`; do
$script start
done' > /system/etc/init.d/S99Optware-ng
chmod 755 /system/etc/init.d/S99Optware-ng
mount -o remount,ro /system
Once again, you may adjust this line
Code:
mount -t tmpfs -o size=64M tmpfs /tmp
if you want greater/lesser RAM disk on /tmp
(4.) You're basically done, but I suggest you now install Optware-ng's dropbear-android package to act as an SSH server:
Code:
ipkg update
ipkg install dropbear-android
dropbear configs are stored in /opt/etc/default/dropbear and by default are:
Code:
DROPBEAR_ENABLE=no
DROPBEAR_PORT=2222
DROPBEAR_PASSWORD=password
Run these commands to adjust configs, enable dropbear and start it:
(replace <*> strings with actual desired values)
Code:
sed -i -e '/^DROPBEAR_PORT=/s/=.*/=<YOUR_PORT>/' -e '/^DROPBEAR_PASSWORD=/s/=.*/=<YOUR_PASSWORD>/' -e '/^DROPBEAR_ENABLE=/s/=.*/=yes/' /opt/etc/default/dropbear
/opt/etc/init.d/S51dropbear start
Now you are advised to use dropbear as SSH server to play with Optware-ng: use 'root' user, '<YOUR_PASSWORD>' password and '<YOUR_PORT>' port
For better security you may use public key authorization only: set password to blank and add your public keys to /opt/etc/dropbear/authorized_keys (don't forget to `chmod 600 /opt/etc/dropbear/authorized_keys` after you create it!) and restart dropbear or just reboot.
P.S. I'm not exactly sure that this is the right place to post this, please move it if needed.

Launch Linux without vnc

I'm new to the forum so please pardon me if my english or explainations are not perfect.
I post here to explain a way to launch linux from android without vnc.
We need to stop android services to do that, but as already explain in other topics, the framebuffer access seems to be blocked on android 4.4 (or above).
I found that the framebuffer can still be accessed but just at the beginning of the boot process.
A way to launch linux is thus to modify the file "/system/etc/install-revovery.sh" (sometimes it is under "/system/bin") wich is started just at the same moment with other android services.
You can for instance add in that file:
busybox mount /dev/block/mmcblk1p1 /mnt/asec
# were mmcblk1p1 is your sdcard
if [ -e /mnt/asec/start.sh ] ; then
setprop ctl.stop zygote
setprop.ctl.stop bootanim
setprop ctl.stop surfaceflinger
setprop ctl.stop servicemanager
# (you should stop all services showed in /init.rc that restart other services)
# (you can repeat the setprop ctl.stop two or three times to be sure they are stopped)
exec busybox chroot /mnt/asec /start.sh
fi
In your sdcard, you should install a linux-arm system (for instance debian, can be done with linuxdeploy app), and place a file "start.sh" like this one:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
mount -t tmpfs none /dev
mount -t proc none /proc
mount -t sysfs none /sys
sleep 1
busybox mdev -s
# (busybox should be installed in the linux-arm system)
mkdir /dev/pts
mount -t devpts none /dev/pts
sleep 1
sudo startx -- vt1
If you reboot your device within your sdcard insert, linux should start. If something goes wrong, just reboot the device without the sdcard (long-press power), and android should restart.
If your kernel doesn't have tty support, it can also work. Just add in the "install-recovery.sh" file:
( while [ 1 ]
do
echo 0>/sys/class/graphics/fb0/rotate
busybox sleep 0.01
done ) &
And in your start.sh you should replace the last line with:
ln -s /dev/null /dev/tty1
sudo startx -- vt1 -sharevts
(I learn this trick by examin the source code of linuxdeploy, wich use it too).
If you're lucky, touchscreen will work (with default evdev driver that comes with linux).
If not, you can try tslib driver (search for "tslib" and "xf86-input-tslib" on olimex website or other places on the web).
For this be aware they are some patchs to apply (can be found on olimex website) and you should compile.
However when sucessfull it seems to work on a good number of devices (you can also try some "tslib-multitouch" patchs that make the driver work on some other devices).
For the keyboard you can use matchbox-keyboard program for instance, wich use the touchscreen to emulate the keyboard.
I've tested this method on two tablets (an allwinner and a rockchip) and on a Wiko phone (MediaTek processor). It has worked for each of three.
Be carefull nevertheless when modifying "install-recovery.sh" (wrong manipulations can brick your device, you are warned, I shall not be responsable for any damage).
Thanks.
Thank you kind sir. This is what I have searching for.
honestly it's kind of funny to know that I've scoured the internet looking for this and it's been right here the whole time I just didn't do a search on this site for whatever stupid reason. you are a gentleman and a scholar, thank you for your time.

Categories

Resources