Related
Update 2010-02-26 Added examples for linking either dynamically or statically (see page 2)
I decided to try and set up a kitchen using the closest thing to a native kernel dev environment that I could set up.
At this point I have:
- cross-compiled the HTC Desire (kernel) sources using the Android 1.6 NDK
- figured out the repo/git stuff to pull the Android sources corresponding to a given Android release point
- cross-compiled the entire Cupcake release to an ARM target using the NDK tools
- built a dynamically linked "hello, world" executable using the NDK arm-eabi-* tools and verified it works on the phone.
Yah, I know - not much yet, but it's a start for a newb.
I have some notes documenting the Ubuntu setup process in case anyone wants it - but it is full of links (URLs), so I can't post anything with links as a new user.
If a mod can "verify" my account, I'll post it up. I promise, I'll be good.
bftb0
OK, I guess I need to make a couple of posts before I can embed links.
I'll post it without the URL protocol prefix (it's gonna look fugly), and then come back and edit it once the restriction is removed. I hope someone finds it useful.
Android kernel dev is not officially supported on Windows; closest match to Google Dev environment seems to be -> Ubuntu 8.04 LTS + JDK 5 (32 bit, not x64).
I realize that this is nothing close to the "kitchens" that the WinMo folks have been using, but figured that (as a newb) I would just end up confusing myself trying to figure out which of those tools could be useful for Android, in addition to needing the native binary cross-compilation tools anyway.
(Note: I briefly tried to set this up in a Ubuntu VMware Player VM, but ran into limitations of available Ubuntu 8.04 LTS player machine file size limits (as well as problems hosting a VM bigger than about 10 Gb on a USB drive - insufficient space on my primary drive)
If anyone wants to follow in my footsteps, here is a thumbnail sketch of useful links. I'll admit, this is not for the faint of heart - you need Linux/Unix skills to work through the kinks.
1) (ubuntu.com/getubuntu/downloadmirrors#mirrors) Ubuntu Download Mirrors list - Find a server near you
2) Download ubuntu-8.04.4-alternate-i386.iso and burn it to 700 Mb CD-R
3) Install Ubuntu 8.04 LTS Desktop Version (gulp!)
4) Use the Ubuntu graphical package manager (System -> Administration -> Synaptic Package Manager) and install the packages (git, flex, bison, etc) mentioned in the "Ubuntu Linux (32-bit x86)" section in this (source.android.com/download)Android Source setup page
5) Note that JDK6 does not work correctly; rather than going to Sun/Oracle for JDK5, install the sun-java5-{bin,jdk,jre,doc,demo} packages (1.5.0-22-0ubuntu) using the Ubuntu package installer mentioned above. Note if you install the docs package, you will also need to go to Sun/Oracle and get jdk-1_5_0-doc.zip towards the end of the package install, and drop it into /tmp for the package manager to finish.
6) Go to the (developer.android.com/sdk/index.html) Android SDK Download page and get android-sdk_r04-linux_86.tgz
7) Unpack ( gunzip -c and...tgz | tar xf - ) to desired location, add tools dir to PATH
Optional Steps (For Java App Devs)
o-8) (eclipse.org/downloads/ Eclipse IDE Download page - chose 'Eclipse Classic 3.5.1 (162 MB)' for Linux, 32 bit (eclipse-SDK-3.5.1-linux-gtk.tar.gz)
o-9) Install by unpacking ( gunzip -c ecli....tar.gz | tar xf - ) to desired location, add eclipse folder to PATH
o-10) Run eclipse, and follow the (developer.android.com/sdk/eclipse-adt.html) Installing and Updating ADT instructions for adding Android functionality to Eclipse 3.5 (Galileo)
o-11) From within Eclipse, launch Window -> Android SDK and AVD Manager, and install all available & compatible Android SDK Tools (all versions). (You might need to use http instead of https... YMMV) Note that this is the same functionality as simply running the command "android" from the command prompt if the Android SDK (steps 6,7) tools directory is in your PATH
12) Familiarize yourself with the command line tool "adb" tool in the SDK; in particular, since Ubuntu needs root privs to access the USB hardware, the best way to start the adb server on your PC is to
Code:
$ sudo /bin/bash
- set up root's environment so the SDK "tools" directory is in root's PATH
- plug your phone into the USB cable
- On the Eris, set the options:
Settings -> Applications -> Development -> USB Debugging (on)
Settings -> Applications -> Development -> Stay awake (on)
Code:
# adb devices
This last command only lists the available USB-connected (real) devices and any emulators you have running, but as a side effect it starts up the adb server on the Ubuntu machine running as root. Thereafter, you can use adb (or ddms) as an unprivileged user.
13) Have a peek at the SDK "ddms" monitor. A variety of things can be done from here, the least of which is screen shots (Select device, then Device-> Screen capture)... and some more twisty things too.
14) Download the (developer.android.com/sdk/ndk/1.6_r1/index.html) Android 1.6 NDK r1 (Native Development Kit) - android-ndk-1.6_r1-linux-x86.zip, and unzip into your desired location. Add the ARM cross-compiler tools to your path (see example below).
15) At this point you might be using something like this to set up your path wherever you please (.profile or elsewhere, according to how you want to manage your environment)
Code:
_INSLOC='/opt/android/'
_JAVAPATH='/usr/lib/jvm/java-1.5.0-sun/bin'
_BASEPATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
_ANDTOOLS="${_INSLOC}"'/android-sdk-linux_86/tools'
_ECLPSPATH="${_INSLOC}"'/eclipse-3.5.1'
_ARMXCOMPILE="${_INSLOC}"'/android-ndk-1.5_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin'
PATH="${_JAVAPATH}"':'"${_BASEPATH}"':'"${_ANDTOOLS}"':'"${_ECLPSPATH}"':'"${_ARMXCOMPILE}"
export PATH
16) Download the (member.america.htc.com/download/RomCode/Source_and_Binaries/desirec-be918f7b.tgz) HTC Desire Kernel Source Code and unpack to a location of your choice.
17) Test your enviroment by building the HTC Kernel code:
$ cd v2_6_27/kernel_msm7k; make
I can't remember if I needed to stuff anything into the environment here (e.g. 'CC' definitions, etc.) - but I know that I didn't need to modify any Makefiles. I think the make system will find all the "arm-eabi-*" executables if they are in your path. You will know soon enough.
18) Try to compile a "Hello, world!" program for the phone. Before you get too far along in this (e.g. "where is crt0.o?"), (honeypod.blogspot.com/2007/12/dynamically-linked-hello-world-for.html) read this blog post - steps 3 and 4 only.
You might find a Makefile similar to this useful:
Code:
AR = arm-eabi-ar
AS = arm-eabi-as
CC = arm-eabi-gcc
CXX = arm-eabi-c++
LD = arm-eabi-ld
NDK_KIT = /opt/android/android-ndk-1.5_r1
PLATF_KIT = build/platforms/android-1.5
ARM_INC = $(NDK_KIT)/$(PLATF_KIT)/arch-arm/usr/include
ARM_LIB = $(NDK_KIT)/$(PLATF_KIT)/arch-arm/usr/lib
PLATF_INC = $(NDK_KIT)/$(PLATF_KIT)/common/include
OBJS = hello.o start.o
EXES = hello
hello: hello.o start.o
$(LD) \
--entry=_start \
--dynamic-linker /system/bin/linker -nostdlib \
-rpath /system/lib -rpath $(ARM_LIB) \
-L $(ARM_LIB) -lc -o hello hello.o start.o
hello.o: hello.c
$(CC) -I $(ARM_INC) -I $(PLATF_INC) -c hello.c
start.o: start.c
$(CC) -I $(ARM_INC) -I $(PLATF_INC) -c start.c
clean:
rm -f $(OBJS) $(EXES)
and then
Code:
$ make hello 2>&1 | tee make_hello-log.txt
if all goes well, push to the phone
Code:
$ adb push hello /sqlite_stmt_journals/hello
and then use a shell on the phone to watch the lights gerblinken:
Code:
PC-path$ adb shell
$ cd /sqlite_stmt_journals
$ ./hello
Hello, world!
$ exit
PC-path$
19) Now, download the Android stock kernel sources:
- Make sure you have "git" and "repo" installed; see the (source.android.com/download) Android "Get source" page, starting from "Installing Repo".
- Make a clean directory to initialize "repo" in, and download the code:
Code:
$ mkdir ~/mydroid
$ cd ~/mydroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
$ repo sync
The sync step above will download the entire source tree corresponding to the Cupcake release (90 minutes on my link).
20) Build the sources
Code:
$ cd ~/mydroid
$ make 2>&1 | tee make_Android-log.txt
On my old PC, this step took about two hours.
Well, that's a little start; everything that comes after this is heavy lifting, I suppose.
bftb0
Thank you for that.
I forgot to add a disk space usage report to this; here it is:
O/S ( /, /boot, /var, /tmp) ~ 4 Gb **
Android SDK, all versions: 1.3 Gb
Android "Cupcake" full sources + full build: 5.5 Gb (2.5 Gb sources, 3.0 Gb build tree)
Android NDK ~0.05 Gb
Eclipse 3.5.1: 0.21 Gb
HTC Desire Kernel Sources + build ~ 0.77 Gb
All up, thats about 12 Gb minimum needed for a full environment. Obviously, you would want some headroom above that.
Note that if you only want to build native binaries, and not the full Android source tree (or develop Java applications), this could be done handily in a virtual machine which is less than 10 Gb in size - for Windows users, there are VMware "Player" versions of Ubuntu 8.0.4 available for that. That eliminates the need for a separate machine, or a dual-boot PC - and the worries of messing up trying to create a dual-boot machine.
All that is really needed for that is the Desktop OS and the NDK. Adding a single version of the SDK so you have 'adb' and 'ddms' available to you would be helpful, but not absolutely necessary if you are using a Windows host machine with those tools already present.
bftb0
** beware that Ubuntu uses a lot of space on /var if you put it in a separate partition - 600+ Mb in my configuration.
bftb0 said:
I forgot to add a disk space usage report to this; here it is:
O/S ( /, /boot, /var, /tmp) ~ 4 Gb **
Android SDK, all versions: 1.3 Gb
Android "Cupcake" full sources + full build: 5.5 Gb (2.5 Gb sources, 3.0 Gb build tree)
Android NDK ~0.05 Gb
Eclipse 3.5.1: 0.21 Gb
HTC Desire Kernel Sources + build ~ 0.77 Gb
All up, thats about 12 Gb minimum needed for a full environment. Obviously, you would want some headroom above that.
Note that if you only want to build native binaries, and not the full Android source tree (or develop Java applications), this could be done handily in a virtual machine which is less than 10 Gb in size - for Windows users, there are VMware "Player" versions of Ubuntu 8.0.4 available for that. That eliminates the need for a separate machine, or a dual-boot PC - and the worries of messing up trying to create a dual-boot machine.
All that is really needed for that is the Desktop OS and the NDK. Adding a single version of the SDK so you have 'adb' and 'ddms' available to you would be helpful, but not absolutely necessary if you are using a Windows host machine with those tools already present.
bftb0
** beware that Ubuntu uses a lot of space on /var if you put it in a separate partition - 600+ Mb in my configuration.
Click to expand...
Click to collapse
great very descriptive thread
Hey bftb0
thanks for posting this guide. I am trying to just play around with someone of the exploit binaries on my eris (from the tattoo/hero rooting threads) , so these guidelines are coming in handy. However for some reason whenever I try and do anything over adb i get this error:
Code:
error: insufficient permissions for device
I cant use adb shell at all, even trying to push to the sdcard gives permissions denied. In the adb devices output the phone is coming up as "?????? no permissions", Did I miss a step ?
My setup so far: Ubuntu 9.10 i386,
Hey bftb0
thanks for posting this guide. I am trying to just play around with someone of the exploit binaries on my eris (from the tattoo/hero rooting threads) , so these guidelines are coming in handy. However for some reason whenever I try and do anything over adb i get this error:
Code:
error: insufficient permissions for device
I cant use adb shell at all, even trying to push to the sdcard gives permissions denied. In the adb devices output the phone is coming up as "?????? no permissions", Did I miss a step ?
My setup so far: Ubuntu 9.10 i386, android-sdk_r04-linux_86, droid eris with most recent OTA
someguy, you have to go to developer.android.com/guide/developing/device.html and install the linux driver (as root) and restart your system.
@someguy
Type "adb kill-server" followed by "sudo adb". You need to run adb as root in unix for it to work.
zifnab06, that was it, I must have not run the first command as root which caused the server to be run without su.
What exactly does this do?
bigcj55 said:
What exactly does this do?
Click to expand...
Click to collapse
Because of the lineage between Linux and Android, the primary platform for compilation of the kernel and other ARM instruction-set binaries ("native" code) has been on Linux. It appears (at the moment...reading between the lines) that Google engineers are using Ubuntu 8.04 LTS as their choice of Linux platform for maintaining Android kernel & utilities code... so, in principle, it is the "best supported" platform for doing "native" development work, if for no other reason than it's what Google has been using. (Not because it is somehow a "better" O/S, but rather because you are likely to run into fewer quirks, and have more resources on the internet who might have experienced the same difficulties that you run into.)
For instance, the folks that have been building kernel exploit programs have been using the Google "NDK". They are not writing/compiling those in Java - they are writing or compiling programs written in "C", and compiling them into native (ARM) object code.
I provided notes from my own installation for anyone considering "dipping their toe" into building Android kernels or native binaries using Linux as a host O/S - most forum readers are not going to be interested in doing that.
Note that Google now releases an NDK for Windows, Linux, and Mac OS/X. The strange thing about doing development on Windows using Cygwin is that if you have sufficient skills to do so - and are capable of resolving problems that inevitably crop up - then you probably already have sufficient skills to be using Unix/Linux in the first place. Sort of depends on your past experience, though. I'd be willing to bet that Devs with a history of doing WinMo development probably would prefer to climb the Android development learning curve by trying their hand with the Windows/Cygwin NDK because of their familiarity with other Windows-based development tools (IDEs, hex editors, assemblers, GUI generators, etc).
That reminds me though - I need to update this thread with something else.
Cheers
bftb0
Static OR Dynamic Linking of Native Binaries
I was a little unsatisfied with the "hack" used in the above examples to circumvent the need to launch programs without linking to C runtime initialization using that strange code shown above, i.e.
Code:
start() { exit( main() ); }
Moreover, for purposes of debugging applications running on the phone (using "gdbserver"), it simply seems easier to link statically - it allows you to step into the syscall library routines and actually see the assembler implementations wrapped around "STI" interrupts.
So, I spent some time experimenting, and came up with a Makefile that allows me to easily toggle between building an ARM executable linked statically or dynamically. Moreover, it lets "argc" and "argv" work they way they are supposed to, and also allows main() to do a return().
Here's an example Makefile, for a program "hello.c". Make sure you read the notes which follow it.
Code:
#
# FIX THESE (to match your installation)
# Top of the Android Source/build tree (retrieved w/ repo)
ANDSRCROOT := /home/user/android/repo-root
# link dynamically against the libraries shipped on the phone!
# e.g.: $cd /opt/android/Eris_libs/ruu1_16_605_1 ; adb pull /system/lib/
PHONELIBS := /opt/android/Eris_libs/ruu1_16_605_1/lib
# Choose one or the other; static is easiest for debugging use
LINKMODE := dynamic
#LINKMODE := static
# tools
CROSS_COMPILE := arm-eabi-
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)ld
AR := $(CROSS_COMPILE)ar
CXX := $(CROSS_COMPILE)c++
OBJDUMP := $(CROSS_COMPILE)objdump
RANLIB := $(CROSS_COMPILE)ranlib
READELF := $(CROSS_COMPILE)readelf
# Note STATLIBROOT is relative to the Android Source root (ANDSRCROOT)
STATLIBROOT := out/target/product/generic/obj/STATIC_LIBRARIES
INCLUDE := -I $(ANDSRCROOT)/bionic/libc/include \
-I $(ANDSRCROOT)/bionic/libc/arch-arm/include \
-I $(ANDSRCROOT)/bionic/libc/kernel/common \
-I $(ANDSRCROOT)/bionic/libc/kernel/arch-arm
ifeq ($(LINKMODE),dynamic)
LIBDIRS := -L $(PHONELIBS)
else
LIBDIRS := -L $(ANDSRCROOT)/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1 \
-L $(ANDSRCROOT)/$(STATLIBROOT)/libc_intermediates \
-L $(ANDSRCROOT)/$(STATLIBROOT)/libc_common_intermediates
endif
ifeq ($(LINKMODE),dynamic)
CRTBEG := $(ANDSRCROOT)/out/target/product/generic/obj/lib/crtbegin_dynamic.o
LDFLAGS := -rpath /system/lib -rpath-link /system/lib --dynamic-linker /system/bin/linker
EXTLIBS := -lc -ldl
else
CRTBEG := $(ANDSRCROOT)/out/target/product/generic/obj/lib/crtbegin_static.o
LDFLAGS := -static
EXTLIBS := -lc -lgcc -lc_common
endif
CRTEND := $(ANDSRCROOT)/out/target/product/generic/obj/lib/crtend_android.o
CFLAGS := -g -Wall
%.o: %.c
$(CC) -c $(INCLUDE) \
$(CFLAGS) $< -o [email protected]
%.s: %.c
$(CC) -S -c $(INCLUDE) \
$(CFLAGS) $< -o [email protected]
all: hello
hello: hello.o
$(LD) $(LDFLAGS) \
-o [email protected] --entry=_start -nostdlib \
$(CRTBEG) \
$^ \
$(CRTEND) \
$(LIBDIRS) $(EXTLIBS)
This makefile has certain assumptions built into it:
(1) Static Linkage
If you are going to link statically, you will need to have already built the entire Android source tree - the Android NDK does not provide any static libraries (In the OP I provided instructions on how to do this download and build the Android "Cupcake" release.)
(2) Dynamic Linking
If you want to compile code which is "as close to the phone as possible" then there is really only one way to do that: compile against the headers that HTC used, and perform linking against the dynamic libraries that you literally pull off the phone ("adb pull /system/lib").
There's only one problem with this strategy: HTC did not release their copy of the bionic (or other library) source code, so you are forced to punt... the second-best choice is to use headers from the Android (Cupcake) source tree. So... you will notice that for both the dynamic-link or static-link cases in the above makefile, the $(INCLUDE) paths used during compilation come from the Android source tree.
bftb0
PS I guess there is a mechanism to configure the top-level "make" of the Android source tree for not only a target type (defaults to "arm"), but also a "machine" dependency. I didn't research that, as I have only built user-space code. I'm doubt there should be any differences at the syscall interface API - excepting perhaps things like ptrace() which have a machine dependency (register structures, etc).
bftb0 said:
Because of the lineage between Linux and Android, the primary platform for compilation of the kernel and other ARM instruction-set binaries ("native" code) has been on Linux. It appears (at the moment...reading between the lines) that Google engineers are using Ubuntu 8.04 LTS as their choice of Linux platform for maintaining Android kernel & utilities code... so, in principle, it is the "best supported" platform for doing "native" development work, if for no other reason than it's what Google has been using. (Not because it is somehow a "better" O/S, but rather because you are likely to run into fewer quirks, and have more resources on the internet who might have experienced the same difficulties that you run into.)
For instance, the folks that have been building kernel exploit programs have been using the Google "NDK". They are not writing/compiling those in Java - they are writing or compiling programs written in "C", and compiling them into native (ARM) object code.
I provided notes from my own installation for anyone considering "dipping their toe" into building Android kernels or native binaries using Linux as a host O/S - most forum readers are not going to be interested in doing that.
Note that Google now releases an NDK for Windows, Linux, and Mac OS/X. The strange thing about doing development on Windows using Cygwin is that if you have sufficient skills to do so - and are capable of resolving problems that inevitably crop up - then you probably already have sufficient skills to be using Unix/Linux in the first place. Sort of depends on your past experience, though. I'd be willing to bet that Devs with a history of doing WinMo development probably would prefer to climb the Android development learning curve by trying their hand with the Windows/Cygwin NDK because of their familiarity with other Windows-based development tools (IDEs, hex editors, assemblers, GUI generators, etc).
That reminds me though - I need to update this thread with something else.
Cheers
bftb0
Click to expand...
Click to collapse
Wow, i was a little off in this case. I was under the assumption y'all were somehow going to compile ubuntu to run on the eris. :O
Following the instructions here, I attempted to install Ubuntu 10.10 on my Archos 70 running Urukdroid 1.5. I'm running it through the terminal emulator and not ADB. When I attempt to run ubuntu.sh I get a lot of errors, and then bootubuntu fails to work.
sh output:
Code:
mount: /system not mounted already, or bad option
FATAL: module ext2 not found.
TERM environment variable not set.
mkdir: cannot create directory '/data/local/mnt': File exists
TERM environment variable not set.
rm: invalid option -- '/'
Try 'rm --help' for more information.
cd: 26: can't cd to /sdcard/ubuntu
chmod: changing permissions of 'bootubuntu': Operation not permitted
(errors for all the other chmods as well)
TERM environment variable not set.
(Ubuntu Chroot Bootloader v0.1, etc.)
And naturally bootubuntu generates a big pile of errors as well. Any suggestions?
There are 3 leethal messages:
I'm not sure about the ext2 message - can't imagine that UD has no ext2 module - need to check it out myself...
"TERM environment variable not set." is obvious - means there is some (TERM) environment variable missing wich is propably set when use adb?!?!
As the variable is used in each command after the error - they fail ... so the folders that should be created or removed propably have the variable in its structure and should sound a bit different...
hard to tell from here need the script - downloading atm - but takes ages
cd: 26: can't cd to /sdcard/ubuntu sounds a bit strange too but again it seems that u can acces sdcar with /sdcard from adb but on UD runtime its mounted /mnt/storage/sdcard...
So either you try to fix those lines in the scriptand find it out - or try follow they guide - and use adb
Well, I decided to redownload the Ubuntu image and try again. This time it went off without a hitch; I guess I had some file corruption in the first download. But now I've done the essential steps (apt-get updates, setting up LXDE environment and VNC server) and when I try to connect to the VNC host I just get a gray screen with an "x" shaped cursor and nothing else.
Same here. X-Server seems to start (grey background, x-shaped cursor), but nothing else. Tried the 2 versions of the xstartup (with, and without the last 2 lines), no change. I had to increase the portnumber with every reboot (working with pocketcloud to connect to the vnc server).
hi guys, this seems to be a problem some people are having with the new 10.10 build, the problem is I cant seem to replicate the problem.
I would recommend trying a fresh ubuntu image without install lxde or the fixes, ie just boot into vncserver.
If this dosnt work then try installing lxde and adding the lines to the xstartup to makesure it uses that desktop.
Thanks
I'm having (unrelated, probably) problems running this on the stock ROM with Chulri's r/w root. I am unable to mount the provided image (or any loopback filesystem, for that matter), whether from the script, or manually from a root shell prompt.
It appears that the stock kernel does not include a loop device driver (built-in, or as module), as there's no 'loop' directory under /sys/module/ and no loop.ko under /lib/modules. The installed busybox is also lacking losetup and chroot, but that's almost beside the point.
To deal with this, I've built a fixed busybox, which works fine, and a custom kernel using Chulri's buildroot, which doesn't, so much. I've built custom kernels for the Archos 70 before, to add compcache and the interactive CPU governor, and they've worked fine. But in this case, I make sure CONFIG_BLK_DEV_LOOP is set to 'y' in linux.config/.config, but after flashing the kernel and rebooting, there still seems to be no loop driver (no loop directory under /sys/module -- it should show up even when compiled-in, which it does on my Fedora desktop). Needless to say, this confuses me, and it's where I stopped working on it.
Has anyone got this working on a Gen8 Archos tablet without Urukdroid?
jfmcbrayer said:
I'm having (unrelated, probably) problems running this on the stock ROM with Chulri's r/w root. I am unable to mount the provided image (or any loopback filesystem, for that matter), whether from the script, or manually from a root shell prompt.
It appears that the stock kernel does not include a loop device driver (built-in, or as module), as there's no 'loop' directory under /sys/module/ and no loop.ko under /lib/modules. The installed busybox is also lacking losetup and chroot, but that's almost beside the point.
To deal with this, I've built a fixed busybox, which works fine, and a custom kernel using Chulri's buildroot, which doesn't, so much. I've built custom kernels for the Archos 70 before, to add compcache and the interactive CPU governor, and they've worked fine. But in this case, I make sure CONFIG_BLK_DEV_LOOP is set to 'y' in linux.config/.config, but after flashing the kernel and rebooting, there still seems to be no loop driver (no loop directory under /sys/module -- it should show up even when compiled-in, which it does on my Fedora desktop). Needless to say, this confuses me, and it's where I stopped working on it.
Has anyone got this working on a Gen8 Archos tablet without Urukdroid?
Click to expand...
Click to collapse
It would seem that loop devices only works well on the Urukdroid rom, so for now if you want ubuntu you will have to use this
[size=+1]Introduction[/size]
What is GenTop2?
GenTop2 is a full-fledged Gentoo Linux able to replace the original Motorola Webtop. It is faster, fully-customizable and gives you the power of a complete Linux system on a mobile phone. It is a peek into the future of mobile computing!
Thanks goes to kholk, who did the original GenTop, otherwise I would have long given up.
Why use Gentoo Linux as WebTop?
Programs are fully optimized for the ARMv7a CPU contained in the Atrix.
Thus the whole system is faster and more responsive.
No shackles put around the WebTop by Motorola.
You can install any program (which compiles on ARM).
All software (except X11) is fully up-to-date.
You remember old times with desktop computers having far slower CPUs and less RAM than your phone and you wonder what you can do with this pocket computer.
Why NOT use Gentoo Linux as WebTop?
Gentoo is huge because it must install all development files.
The system and all programs must be compiled on the phone. How crazy is that?
Firefox could not be built. But, there is a smaller replacement.
Why bother using a phone, when you already have a notebook?
Working and Installed Applications
X11 via WebTop or HDMI (with hdmi-hack)
Xfce4 with thunar file manager
midori web browser with Flash player
claws-mail client
audacious
evince (pdf viewer)
ssh daemon
rxvt terminal
aiw Android In-A-Window!
Sound output via Android media system.
All are very light-weight Linux applications perfect for a small system.
Not Working:
webtop-panel (system status bar on top)
non-flash video playback ?
Installable as binary packages:
firefox (renamed to Aurora due to trademark stuff), approx 30 MB.
thunderbird (renamed to Earlybird due to trademark stuff), approx 44 MB.
libreoffice, approx 250 MB.
abiword, pidgin, emacs, texlive,
and many more, drop a note for more wishes here. However KDE is just too large.
[size=+1]Installation Instructions[/size]
Prerequisites:
Motorola Atrix
[size=+2][highlight]BACKUP.[/highlight] This will break your device![/size]
Okay hopefully it won't. A full restore will of course overwrite the webtop.
root privileges.
unlocking is not necessary.
adb and Linux knowledge.
webtop2sd is not supported (!)
CM7 is NOT supported
GenTop2 Space Requirements, Disk Speeds and a Note About WebTop2SD
Gentoo is very large because packages contain all development files. This cannot easily be changed, therefore one must work around the space limitation of the /osh partition in some way.
I did some "disk" performance measurements using bonnie++ (see [1] for full info). Here the through-put results in short: /data (ext3) 20,800 KB/s read and 6,200 KB/s write, /sdcard (fat32) 21,500 KB/s read and 8,000 KB/s write, /sdcard-ext (ext3) 12,300 KB/s read and 4,200 KB/s write, /sdcard/loopback.img (ext3) 16,150 KB/s read and 4,400 KB/s write.
One way to go would be to require webtop2sd, however, GenTop2 does not support webtop2sd because the read/write speed of the internal sdcard is much faster than on the external sdcard. Thus I tried to install as much on the /osh partition as possible and move directories onto other partitions as necessary, leaving symlinks behind. WebTop2SD also requires dpkg for some reason, which Gentoo does not have.
Therefore, it's pretty unavoidable that you do some space management yourself.
I have decided to utilize the /preinstall partition for /var. I'm not fully sure that this partition is unused on every Atrix released, but I guess in most cases it contains only provider specific bloatware that people don't want anyhow. On my Atrix it contained some car racing game, which I find hilarious to play on a mobile phone.
Anyway, the /preinstall partition is 300 MB and perfect for /var if reformatted to support many small files. The /var/db/pkg/ directory contains lots and lots of small files describing the installed packages. See the installation instruction for the mkfs line.
I also decided to require some extra ext3 partition for further program, data and portage files. It is needed anyhow to install further programs, which is what most people want to do. The /data partition would be the obvious choice and for that reason the first GenTop2 put files in /data/osh/. However, /home/ is also on /data by default and it gets pretty annoying when your home directory is full.
The only alternative to /data is either a partition on an external sd-card or a loopback mounted file-partition on /sdcard/, both are not as fast as /data (/cache cannot be used as it must be wipeable). So there really isn't much choice left except for external storage.
The main GenTop2 tarball puts 630 MB in /osh (leaving 145 MB free) and 178 MB in /preinstall (with 150 MB free), which must be mkfs formatted.
The portage GenTop2 tarball puts 1460 MB into /mnt/gentoo/ of which 475 MB are data files from /osh/usr/ and 810 MB are the portage tree.
[size=+1]Steps to install GenTop2:[/size]
There are some complications involved when using faux123's kernel, because it only contains ext4 filesystem modules and explicit mounting of ext3 will fail. The ext4 module will however mount ext3 filesystem without problems.
use adb shell and get root:
Code:
$ su
# cd /osh
# mv etc etcx
# reboot
Reboot. The above will disable the webtop.
Download http://kristallsturm.de/GenTop2/GenTop2-20120509.tar.gz (275MB) and put it onto /sdcard via USB or adb push.
use adb shell to overwrite the existing WebTop:
Code:
(first we delete /osh)
# cd /
# ls bin
bin: No such file or directory
(this tests whether the old webtop is disabled)
# rm -r osh/*
# ls osh
(should be empty)
(next we disable and reformat /preinstall)
# mount -o remount,rw /dev/block/mmcblk0p12 /system
# mv /system/bin/load_pia.sh /system/bin/load_pia.sh.disabled
# umount /preinstall
(depending on your ROM this might fail. ignore this problem if the following format works)
# mke2fs -m 0 -i 2048 -j /dev/block/mmcblk0p17
# mount -t ext3 /dev/block/mmcblk0p17 /preinstall
(for faux kernel: replace ext3 -> ext4 in above line)
(now we unpack the main tarball)
# df
(/osh and /preinstall should be almost empty)
# cd /
# tar xvzf /sdcard/GenTop2-20120509.tar.gz
# sync
(begin extra for faux kernel: we change ext3 -> ext4)
# sed -i s/ext3/ext4/ /osh/ubuntu.sh
(end extra for faux kernel)
# sync
# reboot
Once rebooted you will get an X11 login on the HDMI connection or you can access the phone via ssh.
Account Passwords:
root / atrix
adas / atrix
To make GenTop2 more useful and to compile/install further packages you currently must have an external sd-card (or someone must devise a method to use a loopback device).
I have partitioned my external sdcard using a desktop computer into the following two partitions:
/dev/block/mmcblk1p1 (remainder)
/dev/block/mmcblk1p2 (4.0 GB, formatted ext3)
Advanced: (Actually most of this stuff is advanced.) You can also use the new GenTop to partition the external sd-card. Open a terminal, and use something along the lines of:
Code:
# fdisk /dev/block/mmcblk1
(partition it, see further description of fdisk on the net)
# mkfs.ext3 -m0 /dev/block/mmcblk1p2
The boot-up script /osh/ubuntu.sh will mount /dev/block/mmcblk1p2 to /mnt/gentoo. This place is referenced by /usr/portage, /var/tmp and /preinstall/usr and will enable emerge if you install the second GenTop2-portage-20120509.tar.bz2 tarball.
Download http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 (124MB) to /sdcard/ using any method.
Use adb shell or a terminal on the desktop
Code:
$ su
# cd /
# tar xvjf /sdcard/GenTop2-20120509-portage.tar.bz2
Note: If you trust your network connection, you can also download and unpack simultaneously (without saving) it using:
Code:
$ su
# cd /
# wget -O - http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 | tar xvj
[size=+1]Installing further software[/size]
How do I install applications in Gentoo?
- Read http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1
- Read http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3
I have set up a portage overlay "atrix-overlay" which unmasks many packages and includes some custom patches required for compilation on arm. It is included in the main tarball and automatically synced alongside "emerge --sync". Most updates will now be performed via this overlay.
See https://github.com/gendol/atrix-overlay for details.
Furthermore, for large binary packages like firefox, thunderbird and libreoffice I have set up a binary package repository with the same USE flags as the atrix-overlay. These are built using cross-compilation on my desktop computer.
See http://kristallsturm.de/GenTop2/packages/
To force installation from binary packages use emerge -G <package>. See the list of "Installable as binary packages" above.
[size=+1]Miscellaneous Questions[/size]
Why no thumb instructions?
- I did a speed test of cryptography functions and thumb instructions were approximately 10% slower than usual ARM code.
Where was GenTop2 compiled?
- Most of the system was fully compiled on my own Atrix. Larger binary packages are compiled on my desktop using cross-compiling.
Why is X11 not up-to-date?
- The only xorg driver I could get working is the one on the original Webtop, and that requires an older version of X11.
Why is udevd not running?
- If you look at logcat there are lots of the following messages, some of which are due to udevd. Disabling udevd reduces (but does not eliminate) these messages and probably also some unnecessary background process that draws battery.
NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'UDEV_LOG' not found
NetlinkListener: ignoring non-kernel netlink multicast message
NetlinkListener: ignoring non-kernel netlink multicast message
[size=+1]Reinstalling the old WebTop[/size]
Some people on the forums struggled to reinstall the old webtop for some reason. It shouldn't be that difficult and I created a tarball of the original Webtop WT-1.2.0-133_38. These instructions were not tested by me:
Download http://kristallsturm.de/GenTop2/WT-1.2.0-133_38.tar.gz to /sdcard/ using any method.
Use adb shell or a terminal to disable mounting of webtop:
Code:
$ su
# cd /osh
# mv etc etcx
# reboot
Use adb shell to unpack original tarball into /osh:
Code:
# cd /
# ls bin
bin: No such file or directory
(this tests whether the webtop is disabled)
# rm -r osh/*
# ls osh
(empty)
# cd /
# /sdcard/WT-1.2.0-133_38.tar.gz
# sync
# reboot
[size=+1]Downloads[/size]
http://kristallsturm.de/GenTop2/GenTop2-20120509.tar.gz (275MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120509-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120509-portage.tar.bz2 (124MB portage tree for /mnt/gentoo/, see above)
http://kristallsturm.de/GenTop2/GenTop2-20120509-portage-filelist.txt (Filelist of tarball for your reference)
Old Downloads
http://kristallsturm.de/GenTop2/GenTop2-20120428.tar.gz (369MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120428-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120428-portage.tar.bz2 (44MB portage tree for /mnt/gentoo/, see above)
http://kristallsturm.de/GenTop2/GenTop2-20120424.tar.gz (364MB main tarball)
http://kristallsturm.de/GenTop2/GenTop2-20120424-filelist.txt (Filelist of tarball for your reference)
http://kristallsturm.de/GenTop2/GenTop2-20120424-portage.tar.bz2 (44MB portage tree for /mnt/gentoo/, see above)
Changelog
From 20120428 to 20120509:
Added atrix-overlay for pulling in updates using layman.
Reorganized /etc/portage/ to symlink into atrix-overlay files.
Removed mplayer from default install.
Added xarchiver, leafpad and some customization for the terminal.
Reorganized directory structure to use /preinstall.
From 20120424 to 20120428:
Readded resolutions to xorg.conf like in original webtop. Nevertheless you can switch using Xfce's settings dialogs.
Installed Flash: copied libflashplayer.so and emerges nss nspr.
Readded lots of the original .desktop files and corresponding icons. These launch Android apps.
[1] http://kristallsturm.de/GenTop2/docs/atrix-bonnie.html
It is a good job. I try this. Thank you.
This is a very agressive aproach. /osh dose have some Moto magic sauce in it. How well can you drive the screnn with a stock X system? Most of the cutesy features from WT I can live w/o, but the "phone"app really is usefull. Seams like this would be worth the effort to figure out.
If I was using a less "pure" setup (spinning up X and the phone app in Motos osh) then bringimng up the desktop in Gentoo, how would that compare to oither the same concept with other distros?
Please post on. I think this is the first time somebidy has run a non /osh X. Would love to see if it really can be done.
exwannabe said:
This is a very agressive aproach. /osh dose have some Moto magic sauce in it. How well can you drive the screnn with a stock X system? Most of the cutesy features from WT I can live w/o, but the "phone"app really is usefull. Seams like this would be worth the effort to figure out.
Click to expand...
Click to collapse
Thanks for pointing that out. Yes, the approach is radical, but not as aggressive as you may think. All the "magic sauce" in /osh lives in /osr/usr/local/ and all of that is retained. The only problem is that some dynamic link libraries are missing, but most of these problems can be fixed.
They actually had to be fixed because the GenTop2 does need to send some magic signals to Moto's PortalApp/DockService to work correctly. This is done using the /usr/local/bin/rmtest tool via the "fbcp" instance of dbus.
Other than /osh/usr/local/, /osh is really just Debian.
With the phone app, you mean the green phone button? I just tested that, it can be added. The phone button is nothing but a .desktop mime file, which calls one of the magic apps /usr/local/bin/androidlauncher. And it popups up in the aiw display.
I even tested the HD Media Center laucher and that too worked without problems. That really should be included in the next GenTop2 tarball.
exwannabe said:
If I was using a less "pure" setup (spinning up X and the phone app in Motos osh) then bringimng up the desktop in Gentoo, how would that compare to oither the same concept with other distros?
Please post on. I think this is the first time somebidy has run a non /osh X. Would love to see if it really can be done.
Click to expand...
Click to collapse
I guess I don't understand what you mean with a non /osh X. GenTop2 does run X11 and you really need to replace the system libaries to get a well-working Gentoo.
Greetings,
Gendol
Great job! Does this work with cm rom's aswell or only with blur based ones? As another fact, we could use distcc or crosscompile distcc to compile most of the stuff, actually even a crosscompile binhost would be doable for several packages. One more thing, we could probably use an .img file on the internal sdcard partition, that would be ext3/4 formatted instead of using the external sdcard (but probably its better and safer to sue the external card, due to the flash wear)
edit: so i tried it on my atrix with nottachtrix rom installed, it starts fine and seems to work rather well, i only saw two to me rather annoying bugs:
1. somehow the X server thinks that my tv (1080p lg) has a virtual size of 1366x768 and will not allow to use the 1920x1080 resolutions that are in the TV's EDID and that the system puts into the xorg.conf file aswell as it shows in the Xorg.0.log
2. the atrix's screen stays on all the time in the "normal mode" and if one uses the mouse on the gentop its moving and functioning on the atrix's screen aswell (ie you can launch apps by accident with the mouse in android)
I do not know if these are issues with nottachtrix or something else, but for me on the "normal webtop" 1080p worked on this same TV.
here the xorg log: http://dl.dropbox.com/u/24268926/Xorg.0.log
Really nice, installing it right now!
Does flash work on Midori?
I don't know about CM7, you'll have to try to replace the Linux system like moto does it.
The X11 screen size defaults to WebTop resolution 1366x768, but you can change that to 1920x1080 by editing /etc/X11/xorg.conf. The first thing to try is to comment out all Modelines and let EDID detection do the work. But for that a monitor must be present, so you need to Zap (Ctrl+Alt+Bckspace) your X, and that brings up the dual input problem.
I also use nottach's ROM. The dual input problem happens when something in motorola's magic communication goes wrong. I have not been able to figure out how in particular moto disables input on the touchscreen. For me it works most of the time. I also have all the Modelines in xorg.conf enabled, because they fit my monitor.
I didnt really focus on Flash, yet. But as it works on the original Webtop, you should just be able to copy the plugin files.
Gendol
Can't get Midori working .. Got network (via ping), but no web browsing
EDIT: Solved by disabling proxy settings inside Midori
i haven't run gentoo in over 10 years but this is tempting!!!!!
Hello! I am a bit newbie in linux and i have 2 questions
1) Could someon please tell me how to install GenTop2-portage-20120424.tar.bz2 tarball?
2) Is there any way to install synaptic so i can install other linux apps?
snik38 said:
Hello! I am a bit newbie in linux and i have 2 questions
1) Could someon please tell me how to install GenTop2-portage-20120424.tar.bz2 tarball?
2) Is there any way to install synaptic so i can install other linux apps?
Click to expand...
Click to collapse
1) use ADB and first post
2) Gentoo Portage - it's command line but very easy
Hmm, anyone using this with webtop over HDMI? I get the login screen, but the webtop touchpad thingie doesn't come up so it's impossible for me to log in.
nalorite said:
Hmm, anyone using this with webtop over HDMI? I get the login screen, but the webtop touchpad thingie doesn't come up so it's impossible for me to log in.
Click to expand...
Click to collapse
you need to use a hd dock, lapdock or a modded powered usb hub with mouse + kb
Vazay said:
1) use ADB and first post
2) Gentoo Portage - it's command line but very easy
Click to expand...
Click to collapse
1) After the reboot i used
adb shell
# tar xvzf /sdcard/GenTop2-portage-20120424.tar.bz2
but it gave me an error, am i using the correct command or i should use something else?
Yes. The touchpad thingy is also an open end. I have no idea why it doesnt come up. The GenTop2 tries to do everything in the same way as the original one, but for some reason that doesnt appear.
I guess the touchpad is some Android program part of DockService or PortalApp, which drive the Webtop switch. But I havent debugged how to activate it.
@snik38
To extract a .tar.bz2 you use tar xvjf ...
Gendol
three items one that caused some grief, but other than that this has lots of cool potential!
I have a stock rom with root.
1. resolution was pretty screwed up. I did try to adjust the resolution, but it was locked into one setting.
2. flash isnt installed on the browser so many websites where disabled.
3. I could not get AIW to start.
I see you answered #1 in a previous post. But I think all three of those items are minimum requirements to replace webtop. BTW great job again! Its seemed much faster than the webtop app.
2. Try to copy the flashplugin from original webtop(not sure if it works with midori)
3. aiw works fine try to reboot the phone
Took me a while to get this all running, but it's great now it is. Have this over Nottachtrix 1.3.1. Everything installed and works fine!
Cheers!
When my phone turns on and gets to the preparing sd, it takes forever. Does this happen to anyone else?
anyone tried to emerge chrome/chromium?
Hello,
I'm gonna describe here a method that can bypass the "loop device not found" bug with Android 4.3 and LinuxOnAndroid (also called Complete Linux Installer).
With that method, you will be able to run Ubuntu 12.04. It will not harm your device, since it's only an application and a "mount loop".
This is not from me, I found some loose informations on LoA's forum and just tried it out. Then I wrote this guide when I finally got it working. Credits are at the end of the post.
Informations :
- Any Kernel should work (I use ElementalX 1.4)
- Any ROM should work (I use ParanoidAndroid 3.99)
- Any 4.3 device should work (this has been seen working on Nexus 4 and Nexus 7 flo).
- This trick should work for any GNU/Linux armel distribution, but you'll have to change some things, like "startlxde" command and others. I can't help you for that.
What do I need ?
- Root access(SuperSu is recommended)
- BusyBox
- a root file explorer (ES File Explorer is recommended)
- Android 4.3 or CustomROM based on 4.3
- A computer running GNU/Linux (Ubuntu is recommended, but this should work with any debian-based distro. LiveUSB should work)
- Internet access (Around 450Mb download is needed, so 3G or 4G is not recommended)
- ... some free time.
What should I do ?
Step 1 : Install apk on your device
Download and install those 3 applications :
- Complete Linux Installer
- Terminal Emulator
- Android-VNC-viewer
Step 2 : Prepare the .img ubuntu disk on your computer
- Start Ubuntu on your computer.
- Download the LinuxOnAndroid "ubuntu.img" from Sourceforge (you'll need the 'small' version : 396Mo)
- Create a new folder (anywhere you want, ext4 partition is recommended, so /home/user is good) and call it "loa" (for LinuxOnAndroid)
Code:
[I]Example : [/I]
mkdir /home/yourname/loa
- Extract the ubuntu1204-v4-small.zip in that folder
- Open a terminal and navigate to the directory where the ubuntu.img was extracted :
Code:
cd /home/yourname/loa
- Enter the following commands :
Code:
#Create the needed directories
mkdir ubuntunew ubuntuold
#Create a new empty .img
dd if=/dev/zero of=ubuntunew.img bs=1M count=0 seek=4096
#Format your new .img into ext4 (original is ext2 and bugs with Android 4.3)
mkfs.ext4 -F ubuntunew.img
#Mount the .img into the directories
sudo mount -o loop ubuntu.img ubuntuold
sudo mount -o loop ubuntunew.img ubuntunew
#Copy the content of downloaded ext2.img into created ext4.img (may process during some time)
sudo cp -r ubuntuold/* ubuntunew
#Unmount mounted .img
sudo umount ubuntuold
sudo umount ubuntunew
Step 3 : prepare your device for the new ubuntunew.img
- Copy the ubuntunew.img (4Go) from your computer to your device
- Place the ubuntunew.img in SDCARD/ubuntu/ubuntunew.img (you'll need to create the directory)
Step 4 : prepare Complete-Linux-Installer for the new ubuntunew.img
- Open "ES File explorer", turn on the "root explorer" option
- Navigate to /data/data/com.zpwebsites.linuxonandroid/files
- Edit bootscript.sh with a text editor :
1) In "Set up loop device and mount image" :
The line :
$bbox mount -t ext2 /dev/block/loop255 $mnt
becomes
$bbox mount -t ext4 /dev/block/loop255 $mnt
2) In "Mount all required partitions" :
add the line :
$bbox mount -o bind /sys/fs/selinux $mnt/selinux
3) In "Unmount all user defined mounts if any" :
add the line :
$bbox umount $mnt/selinux
- Save changes in bootscript.sh
Step 5 : Use Complete-Linux-Installer to boot ubuntunew.img
- Open "Complete-Linux-Installer
- Go to "Launch" > "Settings" > "Add"
Name : Droidbuntu
Image : /storage/emulated/0/ubuntu/ubuntunew.img
- Choose "Droidbuntu" from the list and "Start Linux"
- Proceed with the installation (terminal starts and ask you a few things) :
Code:
Example values I used on my N7 flo :
- resolution : 1920x1200 (I disabled navbar and statusbar, if you did not, you'll have to try acceptable values)
- run vnc : [B]yes[/B] (important! it will allow you to start the GUI)
- run ssh : no
- password : whatever you want
- You should now be in linux shell (you can tell by the [email protected]:/# in the terminal emulator)
- Enter the command :
Code:
#It will allow you to start the GUI by adding startlxde to the xstartup script
echo startlxde | tee /home/ubuntu/.vnc/xstartup
- Leave the terminal alone (don't close it) and open "androidVNC"
Values to use :
Code:
Nickname : Droidbuntu
Password : ubuntu
Adress : localhost
Port : 5900
Username : root
24-bit color (4 bpp)
Check the local mouse checkbox
- Clic on "Connect"
You are now in Ubuntu 12.04 LXDE. :highfive:
You may want to change "entrymode" in settings, and use "Touchpad", it's better in my opinion.
What's next ?
To start Ubuntu later, just open Complete-Linux-Installer and click "Start linux", then once you're in [email protected], open VNC and "connect". Yes, it's that simple.
The command lines need to be entered in terminal emulator, not in lxterm nor any terminal in Ubuntu.
Credits :
LinuxOnAndroid Team
Canonical and partners
Following LinuxOnAndroid forum users : clb, Isei, RobbH
NOTE : My english surely isn't perfect. If I made any errors, or if you don't understand a step, please tell me.
I can upload an ext4 ubuntu.img (described in step 2), but only if it really is necessary. The image is 4.0 Gigabyte and it will take me a long time to upload this... (My upload internet speed is 40Ko/s so it will take 30 hours to upload, and I'll be glad not to^^)
Awesome guide thank you.
Sent from my HTC Desire HD
Could some one post the image prefered-large one because i do not have ubuntu and it seems complicated for a 'noob like me
bogii4 said:
Could some one post the image prefered-large one because i do not have ubuntu and it seems complicated for a 'noob like me
Click to expand...
Click to collapse
This will not work "as it" with the large image, because you are adding the command startlxde to Ubuntu, which will start LXDE, not Unity.
Do not forget that small image uses LXDE, when large image uses Unity. I don't know which command you should use to start Unity in the xstartup script for VNC.
But, if you want some programs that are inclueded in large-image, you can always use "apt-get install nameofthepackageyouwant" in the terminal-emulator while using Ubuntu. This command will download and install the program. But if you want Unity, I can't help you, maybe some else know...
And, by the way. You don't have Ubuntu on your PC but you want to use it on Android ? That's odd^^
can you verify this works on Flo? it's not clear that you have this on your Nexus
reading the working devices list on linuxonandroid.org, it says "It does not work when going to the mount step since there is a bug in 4.3. It should run perfectly after that is fixed."
have a link or two where someone has successfully installed this on their Nexus 7 (Flo)? or do you have screenshots of it on yours?
Midnight_Rider said:
can you verify this works on Flo? it's not clear that you have this on your Nexus
reading the working devices list on linuxonandroid.org, it says "It does not work when going to the mount step since there is a bug in 4.3. It should run perfectly after that is fixed."
have a link or two where someone has successfully installed this on their Nexus 7 (Flo)? or do you have screenshots of it on yours?
Click to expand...
Click to collapse
It works on flo, I posted here in "Neuxs 7 (2013) > Nexus 7 (2013) General" and the title of this thread is "on N7 2013".
I also explained in the introduction that this is a way to bypass the bug with 'mount loop'.
I also said in the "informations" box that it works with 'flo'
I also gave the credits to users from LinuxOnAndroid forum, who made this possible. There you'll find some testimony of people who were able to run it. You can also check RobbH's post on LinuxOnAndroid thread, here, on XDA.
Sorry, but I think that it's pretty clear haha
Sent from my Nexus 7 using xda app-developers app
sure, ok, seems odd though that you edited your OP after you tell me the info i was looking for was already in the OP
whatever, thanks anyway
Midnight_Rider said:
sure, ok, seems odd though that you edited your OP after you tell me the info i was looking for was already in the OP
whatever, thanks anyway
Click to expand...
Click to collapse
I added this to OP :
Code:
Example :
mkdir /home/yourname/loa
I'm trying to help you and others here, I'm not here to be insulted and called a liar. Thank you.
anyway (workaround) we can boot the 'large image as in Unity the full desktop experience? or do we have to wait for an actual fix ?
Just thought I would pop in and say hi.
Thanks to @Vaykadji and everyone else in LoA land that helped get everything running on 4.3 we are finally sorting the bugs.
A beta version of the app featuring the edits needed in the boot script has been pushed to our beta test group and new ext4 images are being cooked as we speak.
Should not be much longer now and LinuxonAndroid will fully support 4.3
bogii4 said:
anyway (workaround) we can boot the 'large image as in Unity the full desktop experience? or do we have to wait for an actual fix ?
Click to expand...
Click to collapse
as I said : the part in the guide where you add "startlxde" to the xstartup script is only for LXDE (so: small image of Ubuntu only). But if you find the same command for Unity, you will maybe be able to boot with Unity.
Note: Unity and LXDE are both "desktop environment", but different ones. Google it if you don't understand, I can't explain this with my poor English :/
I used this method,but in ubuntu 12.04,it's only X cursor and gray desktop.
in ubuntu 13.04,solved this problem. so we best use ubuntu 13.04.
now I have a problem:in ubuntu,I installed openjdk and run java application .if java application not close and run background.then I press power button to close screen,battery drain very quickly.I saw "android os " always awake.one hour maybe drain 5% battery.
if close the java application battery drain normal.and "android os " no longe awake.
this problem only found in nexus 7 (flo), I have run java application in other android device(like nexus 7 2012,htc evo 4g lte,htc incredible) all of them didn't appear this problem.
some people can test this problem?
and how can I resolved it?
sdwshlsdx said:
I used this method,but in ubuntu 12.04,it's only X cursor and gray desktop.
in ubuntu 13.04,solved this problem. so we best use ubuntu 13.04.
now I have a problem:in ubuntu,I installed openjdk and run java application .if java application not close and run background.then I press power button to close screen,battery drain very quickly.I saw "android os " always awake.one hour maybe drain 5% battery.
if close the java application battery drain normal.and "android os " no longe awake.
this problem only found in nexus 7 (flo), I have run java application in other android device(like nexus 7 2012,htc evo 4g lte,htc incredible) all of them didn't appear this problem.
some people can test this problem?
and how can I resolved it?
Click to expand...
Click to collapse
The X cursor and gray desktop appears when you don't add "startlxde" to you xstartup script. I'll try with 13.04 if I have the time, I couldn't tell right know.
Works well on Ubuntu 13.04 small image (but in 13.04, you don't have to do the "echo startlxde | tee /blablabla" command)
a little off topic but.. i was able to boot Windows XP using Bosch it took 10-15mins to fully boot but it is not usable i expected more mouse seems smooth but clicking - the start menu, open something takes forever :/ worth it?
Vaykadji said:
I added this to OP :
Code:
Example :
mkdir /home/yourname/loa
I'm trying to help you and others here, I'm not here to be insulted and called a liar. Thank you.
Click to expand...
Click to collapse
you're right, did not mean to insinuate anything or insult you, that was not my intent. please accept my apologies
Thank you ! We're good.
Now, since this guide will soon no longer be usefull (with LoA being updated), I'm willing to do some researchs on how to improve Linux ARM experience. Because I noticed that they were plenty of cool things that were not ported (or not officially though).
Some repo's are broken for example. Official repo's (I was planning to install LightSpark, a flash-player fork, but no can do). Maybe this will be more usefull for LinuxOnAndroid user's.
And Touch should be released soon for Nexus products (not including flo, but hopefully it'll come quick).
So, with this, it's not touch screen?
Sent from my Nexus 7 using Tapatalk 4
This is a guide about getting a Linux distribution up and running on your Nexus 9. The goal of this thread is to give a basic understanding about how to get a basic system running, but not working throughout all the kinks that come with doing so on tablet style hardware.
This guide will be non-destructive, and won't touch the data on your tablet. Unless of course you've yet to unlock your bootloader, which if that is the case then shame on you.
Some prerequisites before starting this project with your Nexus 9
A Linux distribution running on your computer. Either in a virtual machine or as your main OS.
A USB flash drive
USB OTG cable
Some things that are nice to have
USB hub
USB keyboard
USB mouse
USB network card
Headphone UART cable
A brief overview about what we are going to be doing here.
First we are going to be building an initramfs. This is a small filesystem with a bare minimum set of tools that can be loaded in to RAM space and use. We will be using this while we are initially getting our kernel up and running, to make sure we didn't mess anything up.
Next we will move on to building the actual kernel for the device. We will be running a Android kernel since Nvidia hasn't been the quickest on their attempt to upstreaming everything required to run this device on a upstream Linux kernel. So we'll be running a 3.10 kernel, which is a heck of a lot better than some 3.0 or 3.4 thing that older devices are on.
Third we will be building our rootfs that will run from an external USB storage device, so we don't affect any data actually on the tablet. I may also add to the guide how to partition your internal storage space so we can use that instead.
[Step 0/4]
We need to set up our build environment on our host Linux distribution before we begin anything. I'm going to assume that the host Linux system we are running is Debian/Ubuntu based, so we'll be using apt to grab our packages we need.
Code:
sudo apt-get install gcc g++ git gcc-4.9-aarch64-linux-gnu g++-4.9-aarch64-linux-gnu libncurses5-dev
This installs the host gcc and AArch64 cross compiler, along with git. We will need these tools to build everything required.
Things that don't work.
Rebooting
Touchscreen
Way more things that people care about
The first step that we will be doing is building our filesystem that we will load in to memory for testing.
This is typically called an initramfs, which tends to be a compressed filesystem that gets copied in to a kernel image once the kernel is built. We won't be using this image for long, as it is mostly to make sure we have everything working correctly before jumping to a full linux distribution.
This step is technically unnecessary, but it brings you up to speed with what initially needs to be done to get something running.
So starting off, we are going to need to pick a target for the filesystem. I've decided to go with buildroot since it is a project that is really easy to get built.
Steps Overview
Clone buildroot with git
Setup buildroot to cross compile
Set up basic options
Compile!
1)*Clone buildroot from github.
Code:
git clone https://github.com/buildroot/buildroot.git
cd buildroot
2)*Start configuring buildroot
Code:
make menuconfig
This will bring up a menu for determining how we want to build our buildroot. We have quite a few things to change.
These options enable building an AArch64 capable buildroot using the Linaro AArch64 toolchain, with it outputting a terminal to ttyFIQ0 which is the headphone UART terminal. Along with taking the filesystem and pushing it in to a cpio archive which later the linux kernel understands how to use.
Target options->Target Architecture->AArch64
Toolchain->Toolchain type->External toolchain
External toolchain automatically enables the Linaro AArch64 toolchain below it.
System configuration->getty options->TTY port->ttyFIQ0
Filesystem images->cpio the root filesystem
3)*Build the buildroot
Code:
make
This will go through downloading all the packages required to build an AArch64 buildroot. So go make a cup of tea, this should only take a few minutes depending on your internet speed and computer speed.
Once the system has gone through compiling everything, then you'll have a file available.
This file will end up in the `output/images/` folder as the file 'rootfs.cpio'. If that file isn't there then something terrible has happened.
If the file is there, then everything on this step is done! We built our temporary filesystem which we will be putting to use in the next step!
This is really the meat of the guide. Building the kernel correctly is half the battle with running a full Linux distribution on the device. We are going to be pulling our kernel from the official Android repository and changing the default configuration to suit our needs.
Steps Overview
Clone kernel with git
Configure environment for cross-compiling
Configure the kernel for building correctly
Test run kernel
1) Clone the kernel using git
This step will take quite a bit of time since it is fairly large.
Code:
git clone https://android.googlesource.com/kernel/tegra.git
cd tegra
2)*Checkout the correct branch
Code:
git checkout android-tegra-flounder-3.10-lollipop-release
3)*Set environment variables for cross-compiling the Linux kernel
Code:
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
4) Configure the kernel
Code:
make flounder_defconfig
make menuconfig
This will bring up a menu just like how the buildroot menu came up. We need to set a few options to make sure everything comes up correctly on the Nexus 9.
General setup->Cross-compiler tool prefix->aarch64-linux-gnu-
General setup->Initramfs source file(s)-><The cpio file that was built in the buildroot>
Mine was '/home/ryanh/work/N9_Kernel_Tutorial/buildroot/output/images/rootfs.cpio'
Device Drivers->Character devices->Virtual Terminal
Device Drivers->Generic Driver Options->Maintain a devtmpfs filesystem to mount at /dev
Device Drivers->Generic Driver Options->Automount devtmpfs at /dev...
Device Drivers->Network device support->Wireless LAN->Firmware path->/lib/firmware/fw_bcmdhd.bin
Device Drivers->Network device support->Wireless LAN->NVRAM path->/etc/wifi/bcmdhd.cal
Device Drivers->Character devices->Virtual terminal
Device Drivers->Watchdog Timer Support->Tegra watchdog (Disable it)
Device Drivers->Staging drivers->Android->Put the FIQ debugger into console mode by default
Device Drivers->Graphics support->Tegra Framebuffer driver
Device Drivers->Graphics support->Console display driver support->Framebuffer Console support
Device Drivers->Graphics support->Console display driver support->Map the console to the primary display device
Device Drivers->Graphics support->Console display driver support->Framebuffer Console Rotation
We've got to enable the tegra watchdog otherwise the device will reboot automatically every two minutes.
The few other things are needed for a sane Linux environment and also setting the initramfs file as our root filesystem.
5)*Compile the kernel
Code:
make -j5
If you're lucky it will build without error and you'll have a file in 'arch/arm64/boot/' named 'Image.gz-dtb' which is the final kernel file.
With this file we should be able to boot a kernel with a buildroot automatically mounted.
Test run the kernel!
This is where I recommend having your headphone UART cable, because this won't update the screen at all and it will seem like it has locked up. The cable is fairly easy to make with a little bit of know how about soldering and electronics, and will save you from tearing out your hair trying to figure out what went wrong.
Without the cable you won't be able to see any output, so either build the cable or skip this step.
To see output from the cable you need to connect to it with either gnu screen or minicom
Code:
sudo screen /dev/ttyUSB0 115200
To boot the kernel reboot in to the bootloader and then boot the kernel using fastboot
Code:
adb reboot bootloader
fastboot -c "console=ttyFIQ0,115200n8 rw" boot arch/arm64/boot/Image.gz-dtb
Once you do this, over the UART cable you'll see the Linux kernel booting and have a buildroot login terminal.
The default username is 'root' without any password.
Code:
Welcome to Buildroot
buildroot login: root
# uname -a
Linux buildroot 3.10.40-ga3846f1 #2 SMP PREEMPT Sat Dec 27 06:15:13 CST 2014 aarch64 GNU/Linux
This shows that the kernel is booting properly and jumping in to our buildroot correctly.
To go back in to Android from this area just type reboot in to the terminal instance.
The final step in getting a Linux distro is to build our root filesystem on a USB flash drive.
Steps Overview
Format flash drive as ext2/ext3/ext4
Dump Ubuntu rootfs on to the flash drive
Minor configuration
Rebuild Linux kernel with new options
The first thing we will want to be doing is formatting a flash drive to a Linux partition type. I am going to be using an ext3 partition on a 64GB USB 3.0 flash drive. I'd recommend at least an 8GB flash drive, anything smaller may have issues with fitting everything on to it.
Once you're done flashing your drive you'll need to download an Ubuntu Core image for AArch64/ARM64/ARMv8.
Download the Ubuntu Core 14.04.1 image*Here. Make sure to grab the 'arm64' tar.gz file, not the 'amd64' file.
Once you have the flash drive formatted and mounted, extract the ubuntu core image to the flash drive.
Code:
sudo tar zxf ubuntu-core-14.04.1-core-arm64.tar.gz -C Mount/
Configuring the Ubuntu Core image for the Nexus 9
Steps Overview
Terminal over UART configuration
DNS configuration
Firmware files
Add user
In order to properly get a terminal instance over the UART we have to add a package to the base Ubuntu core image.
This is a small package that all it does is open a new terminal instance over the configured getty instance. The package can be found*Here.
To install it to the root filesystem just unpack it to the root filesystem on the USB flash drive
Code:
sudo tar xf console.tar -C Mount/
We need to set up a DNS server so that the filesystem will be able to resolve addresses via DNS.
Let's just set it to Google's DNS.
Code:
sudo echo 'nameserver 8.8.8.8' >> Mount/etc/resolv.conf
We've got to grab the firmware files from the Nexus 9 in order for the device to stop spamming warnings at us in the console.
These are used for multiple things, so it is a good idea to grab them. You can grab these either from a factory image or directly from the Nexus 9. I chose to grab mine directly from the Nexus 9.
Code:
sudo mkdir Mount/lib/firmware
sudo mkdir Mount/etc/wifi
sudo adb pull /vendor/firmware Mount/lib/firmware/
sudo adb pull /system/etc/wifi/bcmdhd.cal Mount/etc/wifi/
We need to add a user to the root filesystem. This is a fairly annoying step because we actually need to chroot in to the filesystem.
There is a really nice guide to doing this on a ARMv7 filesystem*Here. This won't work for our system because we are working with ARMv8 instead.
So we are going to use that guide as a base but change it over to support what we need to do for AArch64.
First thing we've got to do is build qemu as a static binary for AArch64
This is fairly straight forward.
Code:
git clone git://git.qemu-project.org/qemu.git
cd qemu
sudo apt-get build-dep qemu
./configure --target-list=aarch64-linux-user *--static --disable-werror
make -j5
This will get us a binary in the aarch64-linux-user folder called 'qemu-aarch64'
We will need to rename this to 'qemu-arm64-static' and move it in to the '/usr/bin/' folder inside of our root partition
Once qemu is inside of the root partition, we will be able to chroot in to it and add our user.
So go in to the root directory of our filesystem we are generating, and run a few basic commands.
Set up some mounts inside of the chroot
Code:
for m in `echo 'sys dev proc'`; do sudo mount /$m ./$m -o bind; done
*Chroot in to the root filesystem
Code:
sudo LC_ALL=C chroot . /bin/bash
Now we are inside of the root filesystem, we can add the new user to it.
Let's just add a new user named 'ubuntu'. The first command will ask for a password for your user. The rest will add it to some default groups to make sure it can do things.
Code:
adduser ubuntu
addgroup ubuntu adm
addgroup ubuntu sudo
Once the user is added you can exit the root filesystem with a regular exit command, then we have to make sure to unmount all of the mounts we did prior to chrooting in to the filesystem.
Code:
for m in `echo 'sys dev proc'`; do sudo umount ./$m; done
Make sure to cleanly unmount the flash drive so everything is written to it.
Reconfigure the kernel to boot from flash drive instead of initramfs
1)*Go in to the kernel configuration
Code:
make menuconfig
Change the configuration to remove the initramfs
General Setup->Initial RAM filesystem and RAM disk (initramfs/initrd) support (Disable it)
Then exit the menu and rebuild the kernel
Code:
make -j5
Running the Ubuntu Core Image
So with the device sitting at the bootloader we will need to boot the new kernel
Code:
fastboot -c "fbcon=rotate:1 root=/dev/sda1 rootwait rw" boot arch/arm64/boot/Image.gz-dtb
This will boot the kernel and then it'll wait until you plug in the flash drive to continue booting.
So plug the USB hub in to the USB OTG cable. Then plug your USB flash drive and USB keyboard in to the USB hub.
After that plug the USB OTG cable in to the tablet and it will continue booting.
Give it roughly 20-60 seconds and it will show a login prompt on the devices screen.
You'll be able to login to the core image with the user you created earlier.
With some packages installed like the xubuntu-desktop environment you can have a full desktop available.
Reserved for QA - Additional Information - Misc
Information
Hardware acceleration
Potentially hardware acceleration should be possible using the Nouveau video driver. This is completely untested, and the Nouveau version included with Ubuntu 14.04 isn't new enough to have GK20a support. One would most likely need to build Nouveau from ToT to get support.
Known Issues
If something tries enabling the wifi chipset then the kernel will hardlock and cause the device to reboot. It may be best to disable the broadcom driver in the kernel until that is figured out.
Bluetooth doesn't seem to work. Not sure why not. Seems to show up as a device, but it can't be used.
Wow thanks for taking the time to post this tuturial.
Greatly apriciated.
Nice work, excellent writeup.
Cant wait to try!!
---------- Post added at 08:35 PM ---------- Previous post was at 08:31 PM ----------
Where did you get your headphone UART cable
Great work sonic, been waiting for this. Will try and report back.
I took some time to figure out how to fix the integrated wireless LAN in the tablet.
This requires grabbing an additional file from the tablet and configuring a few kernel options so they know where the new file locations are since previously they are configured to Android specific locations.
Seems to work fine on my 802.11n 2.4Ghz network.
Running into a snag while compiling the kernel. It always fails at this exact spot on Ubuntu 14.10. Any ideas? (first time compiling a kernel from source )
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
farmerbb said:
Running into a snag while compiling the kernel. It always fails at this exact spot on Ubuntu 14.10. Any ideas? (first time compiling a kernel from source )
Click to expand...
Click to collapse
Note: that does not tell me what failed
When the build failes can you do
Code:
make
Then give me the output
USBhost said:
Note: that does not tell me what failed
When the build failes can you do
Code:
make
Then give me the output
Click to expand...
Click to collapse
OK, here's what failed. Looks like an error in qcom_usb_modem_power.c:
Looks like it's having a fit in a required module that is enabled for the tegra platform.
Looks like a new warning that has cropped up in a newer version of GCC? My AArch64 gcc version that I'm running is 4.8.2. I can install 4.9.1 and test there but it will have to be later.
GCC is definitely right in this case though, Qualcomm managed to screw up a basic memset function call. The zero is supposed to be the middle argument, and GCC recognizes it as an warning now. Which gets upgraded to an error with some configuration.
If you know light C/C++ you can change those two lines that it is complaining about to be correct.
Should be
memset(modem->ftrace_cmd, 0, sizeof(modem->ftrace_cmd));
and
memset(modem->msr_info_list, 0, sizeof(modem->msr_info_list));
For those two lines at 1912 and 1915 respectively.
Looks like I'm going to have to start a patch set for this to work around Qualcomm failing.
sonicadvance1 said:
Looks like it's having a fit in a required module that is enabled for the tegra platform.
Looks like a new warning that has cropped up in a newer version of GCC? My AArch64 gcc version that I'm running is 4.8.2. I can install 4.9.1 and test there but it will have to be later.
GCC is definitely right in this case though, Qualcomm managed to screw up a basic memset function call. The zero is supposed to be the middle argument, and GCC recognizes it as an warning now. Which gets upgraded to an error with some configuration.
If you know light C/C++ you can change those two lines that it is complaining about to be correct.
Should be
memset(modem->ftrace_cmd, 0, sizeof(modem->ftrace_cmd));
and
memset(modem->msr_info_list, 0, sizeof(modem->msr_info_list));
For those two lines at 1912 and 1915 respectively.
Looks like I'm going to have to start a patch set for this to work around Qualcomm failing.
Click to expand...
Click to collapse
I made the changes to qcom_usb_modem_power.c as you listed, and got the kernel to compile okay.
Starting from a fresh Ubuntu 14.10 install (inside a VM), I ended up installing these additional packages in addition to the ones you list in step 0:
Code:
libncurses5-dev libc6:i386 libstdc++6:i386 zlib1g:i386 qemu binfmt-support qemu-user-static android-tools-adb android-tools-fastboot
To get the kernel to compile, I also needed to symlink aarch64-linux-gnu-gcc-4.9 to aarch64-linux-gnu-gcc in /usr/bin, for make to recognize the correct gcc program.
But anyway, I've gotten my N9 booted to the Ubuntu login prompt Now I just need to grab a USB keyboard so that I can actually login!
Thanks so much for the guide! Can't wait for MultiROM to be ported to our device, to make this easier to boot
farmerbb said:
I made the changes to qcom_usb_modem_power.c as you listed, and got the kernel to compile okay.
Starting from a fresh Ubuntu 14.10 install (inside a VM), I ended up installing these additional packages in addition to the ones you list in step 0:
Code:
libncurses5-dev libc6:i386 libstdc++6:i386 zlib1g:i386 qemu binfmt-support qemu-user-static android-tools-adb android-tools-fastboot
To get the kernel to compile, I also needed to symlink aarch64-linux-gnu-gcc-4.9 to aarch64-linux-gnu-gcc in /usr/bin, for make to recognize the correct gcc program.
But anyway, I've gotten my N9 booted to the Ubuntu login prompt Now I just need to grab a USB keyboard so that I can actually login!
Thanks so much for the guide! Can't wait for MultiROM to be ported to our device, to make this easier to boot
Click to expand...
Click to collapse
ii cant wait
Excellent guide. Thank you very much.
It appears the "*" in this configure command below may be a typo?
sonicadvance1 said:
Code:
git clone git://git.qemu-project.org/qemu.git
cd qemu
sudo apt-get build-dep qemu
./configure --target-list=aarch64-linux-user *--static --disable-werror
make -j5
Click to expand...
Click to collapse
Anyway, I am running into a more serious issue (Problem resolved. See bottom.) executing dynamically build aarch64 binaries. On my 14.10 x86 machine, I am able to execute statically build aarch64 binaries using my new qemu-aarch64 emulator. I am not able to execute dynamically build aarch64 binaries. For instance, when I try to execute bin/bash from the mounted root filesystem directly on the host, it will complain:
/lib/ld-linux-aarch64.so.1: No such file or directory
Now this is all right, because I don't have the required aarch64 shared libs on my x86 machine. So I copied qemu-aarch64 to /usr/bin/qemu-aarch64-static on the mounted root filesystem. However, when I run chroot (executing the same /bin/bash):
sonicadvance1 said:
Code:
sudo LC_ALL=C chroot . /bin/bash
Now we are inside of the root filesystem, we can add the new user to it.
Click to expand...
Click to collapse
...I am getting this:
chroot: failed to run command ‘/bin/bash’: No such file or directory
I think this is due to the same issue as above: that qemu is looking for aarch64 shared libs (/lib/ld-linux-aarch64.so.1 is needed to run bash) on my host machine. Should it not, due to chroot, look for them in the mounted root filesystem (where they actually are)?
Other than this... my ARM64 kernel is booting fine. The only problem is, that I cannot login to it yet, because I wasn't able to add a new user.
Edit: Interestingly, the following "works":
Code:
$ sudo chroot . usr/bin/qemu-aarch64-static /bin/bash
bash: /usr/bin/groups: No such file or directory
[email protected]:/#
Now inside the chroot running the aarch64 variant of /bin/bash, I am still unable to start any aarch64 executables. But tab-completion works and I am able to find and run /usr/bin/qemu-aarch64-static (the x86 binary). Could this be a problem with any binfmts mappings inside chroot? Odd.
Edit 2: Solved. Just tried from another machine (10.04) and here, everything is working perfectly. I probably have chroot hosed on my 1st machine. Excellent guide. One last note: if you don't have qemu installed on your host machine, you may need to run the following:
Code:
sudo apt-get install qemu binfmt-support qemu-user-static
t1mur said:
Excellent guide. Thank you very much.
It appears the "*" in this configure command below may be a typo?
Anyway, I am running into a more serious issue executing dynamically build aarch64 binaries. On my 14.10 x86 machine, I am able to execute statically build aarch64 binaries using my new qemu-aarch64 emulator. I am not able to execute dynamically build aarch64 binaries. For instance, when I try to execute bin/bash from the mounted root filesystem directly on the host, it will complain:
/lib/ld-linux-aarch64.so.1: No such file or directory
Now this is all right, because I don't have the required aarch64 shared libs on my x86 machine. So I copied qemu-aarch64 to /usr/bin/qemu-aarch64-static on the mounted root filesystem. However, when I run chroot (executing the same /bin/bash):
...I am getting this:
chroot: failed to run command ‘/bin/bash’: No such file or directory
I think this is due to the same issue as above: that qemu is looking for aarch64 shared libs (/lib/ld-linux-aarch64.so.1 is needed to run bash) on my host machine. Should it not, due to chroot, look for them in the mounted root filesystem (where they actually are)?
Other than this... my ARM64 kernel is booting fine. The only problem is, that I cannot login to it yet, because I wasn't able to add a new user.
Edit: Interestingly, the following "works":
Code:
$ sudo chroot . usr/bin/qemu-aarch64-static /bin/bash
bash: /usr/bin/groups: No such file or directory
[email protected]:/#
Now inside the chroot running the aarch64 variant of /bin/bash, I am still unable to start any aarch64 executables. But tab-completion works and I am able to find and run /usr/bin/qemu-aarch64-static (the x86 binary). Could this be a problem with any binfmts mappings inside chroot? Odd.
Click to expand...
Click to collapse
I ran into these exact issues as well, and was eventually able to get the chroot working properly
Make sure you have the qemu, binfmt-support, qemu-user-static packages installed, and run 'update-binfmts --display' to ensure that aarch64 support is registered properly. Also make sure you've named the 'qemu-aarch64' binary as 'qemu-arm64-static' (not 'qemu-aarch64-static') at usr/bin on the flash drive (the Ubuntu Core image recognizes its architecture as arm64, not aarch64)
farmerbb said:
I ran into these exact issues as well, and was eventually able to get the chroot working properly
Make sure you have the qemu, binfmt-support, qemu-user-static packages installed, and run 'update-binfmts --display' to ensure that aarch64 support is registered properly. Also make sure you've named the 'qemu-aarch64' binary as 'qemu-arm64-static' (not 'qemu-aarch64-static') at usr/bin on the flash drive (the Ubuntu Core image recognizes its architecture as arm64, not aarch64)
Click to expand...
Click to collapse
Ah... it's really good to know one isn't alone. Hehe. Well, it looks like 14.10 is better suited for compiling the arm kernel (gcc-4.9-aarch64 etc.), but doing the chroot is smoother on 14.04.
But how do I get wifi and/or USB ethernet up? And why do have to look at this?
unable to stat /etc/sudoers: no such file or directory
Did you get this too?
t1mur said:
Ah... it's really good to know one isn't alone. Hehe. Well, it looks like 14.10 is better suited for compiling the arm kernel (gcc-4.9-aarch64 etc.), but doing the chroot is smoother on 14.04.
But how do I get wifi and/or USB ethernet up? And why do have to look at this?
unable to stat /etc/sudoers: no such file or directory
Did you get this too?
Click to expand...
Click to collapse
I'm still working on getting networking and X.org running myself. It will recognize my ASIX USB adapter (in the dmesg log) but eth0 doesn't show up and 'ifconfig eth0 up' doesn't work. Haven't tried Wi-Fi yet. My low-level Linux knowledge isn't all that great However, I can still chroot back into the filesystem on my PC and update/install packages, etc. in the meantime.
No I don't see the /etc/sudoers error.