[WIP/DEV/GUIDE] Debian Linux armhf - Acer Iconia A500

So following a couple of tuts that I've found on the forums I've been able to install debian linux wheezy armhf build on my tablet in a dual boot configuration with it booting off of a second ext4 partition on the microsd card along with getting the drivers/codecs from Linux4Tegra to be installed and somewhat used on debian linux.
What works:
-Wifi
-USB
-Display (doesnt use tegra drivers)
-Buttons (power, vol, rot switch [acts as wifi switch])
-Touchscreen
What doesnt work:
-Bluetooth (Untested but apparently it finds it and sets it up.)
-Audio (Detects it in the kde info center. System Settings program only says that there's a dummy output. Playing any form of audio crashes the program.)
-HDMI (with the Tegra gfx drivers it finds it but says it's disconnected even when connected.)
-Cameras
-GPS
-Motion Sensing
-Light Sensor
With the display, whenever the tegra drivers are used, it finds HDMI (as HDMI-1) and the LCD screen (as LVDS-1) but says that there is no device on the lcd screen. With that being said, it is using the fbdev driver instead which shows pink and/or inverted colors in some instances but at least it shows a gui.
Guides used:
{HOW TO} Native Debian on A500 and building your own rootfs
[BOOTLOADER][DUALBOOT + RECOVERY][BOOTMENU] Patched ICS bootloader V8 (07/06/2012)
[Dev] Native linux on Iconia
Requirements:
-an A500.
-a 16+GB microsd.
-Linux OS (Debian, Ubuntu, etc.)
-Linux 4 Tegra: Download the Ventana files under "Additional Information" and "Driver Packages"/"Codec Packages".
Ok, so here's how I've done it.
1) Make sure you have a multiboot loader and have flashed the appropriate bootloader image to the second boot partition. get the boot image from the 3rd guide under "precompiled kernel image" and flash that to the second boot partition. (be sure to check the dualboot guide above on flashing the image if you are using the bootloader that is in the guide.)
2) Have a microsd card partitioned with two partitions, one for normal data (can be any format) and a second one that is in ext4. you can do 3 partitions by adding a swap partition but the ext4 partition must be the second partition.
3) Install qemu on the host system.
Code:
For Ubuntu - sudo apt-get install qemu-user-static
4) Mount the microsd's ext4 partition.
Code:
sudo mount -t ext4 /dev/<microsd 2nd partition> /mnt/Linux
5) Run:
Code:
sudo qemu-debootstrap --arch armhf wheezy /mnt/Linux
6) Chroot into the installed environment.
Code:
chroot /mnt/Linux /bin/bash
7) Add sources to /mnt/Linux/etc/apt/sources.list. you can get debian sources from http://debgen.simplylinux.ch/. Be sure to choose "Testing (wheezy)" and all the sources check boxes along with where you live to find the nearest repository.
8) Install the wifi drivers pt1.
Code:
apt-get update ; apt-get install broadcom-sta-common broadcom-sta-source firmware-b43-installer firmware-b43legacy-installer b43-fwcutter
9) Install the wifi drivers p2. In the "{HOW TO} Native Debian on A500 and building your own rootfs" guide, there is a download from mediafire for the firmware files for the drivers. Extract that and put it into /lib/firmware. I dont know if the individual files in the brcm should be in the /lib/firmware or not so i just copied the folder into it and the files within it into /lib/firmware.
10) Install the GUI:
Code:
apt-get install <gui>
List of GUI's (that i know of):
Code:
KDE (takes a long time to install): kde-full
XFCE: xfce4
11) extract the ventana_Tegra-Linux-R16.1.0_armhf.tbz2 file and the ventana_Tegra-Linux-codecs-R16.1.0_armhf.tbz2. you should get a folder called "Linux_For_Tegra" and a file called "restricted_codecs.tbz2". go into the "Linux_For_Tegra/nv_tegra" folders and extract the nvidia_drivers.tbz2 file. from there you should get 3 folders: etc, lib, usr. copy those to "/mnt/Linux" (you are going to have to do this as root). back out of those folders and extract the restricted_codecs.tbz2. you should get a folder called "lib" copy that to "/mnt/Linux". after that, it's time to make a hard link so that the X11 can find the tegra driver:
Code:
ln /usr/lib/xorg/modules/drivers/tegra_drv.abi12.so /usr/lib/xorg/modules/drivers/tegra_drv.so
Note: without using an xorg.conf file, by default it will use fbdrv instead of the tegra driver.
12) set the root password:
Code:
passwd root
13) add a normal user:
Code:
adduser <username>
14) exit chroot by typing "exit" and unmount /mnt/Linux:
Code:
sudo umount /mnt/Linux
15) pop that sucker into the the tablet and boot into it by holding power and vol down to get into the boot menu. select "boot into second partiton".
If everything went ok, you should be presented with a gui, if not and you are at a command line, log into root and type "startx". if that doesnt work then something wrong must have happened.
Untested easy script:
Code:
#! /bin/sh
set -e
#if there is a tegra_install.deb file.
hasTegraDeb=0
tegraDeb=acer-iconia-tab-a500+tegra+brcm+wheezy_1.0-1_armhf.deb
#change these if you do not like default install of kde.
arch=armhf
build=wheezy
rootDir=/mnt/Linux
guiEnv=kde-full
newUser=User
#setup the basics of debian linux using armhf and wheezy build.
qemu-debootstrap --arch $arch $build $rootDir
#copy the tegra_install.deb file for the tegra specific drivers.
if ["$hasTegraDeb" = "1"] then
cp $tegraDeb $rootDir/$tegraDeb
fi
#setup sources.list for apt-get.
echo "deb http://ftp.us.debian.org/debian testing main contrib non-free" >> $rootDir/etc/apt/sources.list
echo "deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free" >> $rootDir/etc/apt/sources.list
echo "deb http://security.debian.org/ wheezy/updates main contrib non-free" >> $rootDir/etc/apt/sources.list
#create the chroot_install.sh script and set it up.
echo "#! /bin/sh" > $rootDir/chroot_install.sh
echo "set -e" >> $rootDir/chroot_install.sh
#update apt-get inside the chroot.
echo "apt-get update" >> $rootDir/chroot_install.sh
#install the wireless card drivers inside the chroot.
echo "apt-get install broadcom-sta-common broadcom-sta-source firmware-b43-installer firmware-b43legacy-installer b43-fwcutter" >> $rootDir/chroot_install.sh
#install the desktop in the chroot. (note: this will take a long time)
echo "apt-get install $guiEnv" >> $rootDir/chroot_install.sh
#install the tegra specific drivers inside the chroot
if ["$hasTegraDeb" = "1"] then
#install the tegra drivers.
echo "dpkg -i $tegraDeb" >> $rootDir/chroot_install.sh
#hard link the tegra_drv.abi12.so as tegra_drv.so in /usr/lib/xorg/modules/drivers/ to enable X11 to find the display driver.
echo "ln /usr/lib/xorg/modules/drivers/tegra_drv.abi12.so /usr/lib/xorg/modules/drivers/tegra_drv.so" >> $rootDir/chroot_install.sh
fi
#set the root password in the chroot.
echo "passwd root" >> $rootDir/chroot_install.sh
#add normal user in the chroot.
echo "adduser $newUser" >> $rootDir/chroot_install.sh
#execute the final stage of the install.
chroot $rootDir /chroot_install.sh
#cleanup
rm $rootDir/chroot_install.sh
if ["$hasTegraDeb" = "1"] then
rm $rootDir/$tegraDeb
fi
Script sets up everything along with installing kde window manager. Please note that the tegra_install.deb file does not exist, it is something that i am thinking of making in the future that has all the drivers and what not needed that is from the Linux 4 Tegra site. you are still going to have to manually install the tegra drivers in step 11.
Edit: Experimental copies of the deb files that has all the files needed from Linux 4 Tegra and the wifi drivers can be found at the bottom of the post.
xorg.conf to enable tegra driver (found in the Linux_for_Tegra/nv_tegra/config.tbz2/etc/X11 folder):
Code:
# This is the minimal configuration necessary to use the Tegra driver.
# Please refer to the xorg.conf man page for more configuration
# options provided by the X server, including display-related options
# provided by RandR 1.2 and higher.
# Disable extensions not useful on Tegra.
Section "Module"
Disable "dri"
Disable "dri2"
Disable "glx"
SubSection "extmod"
Option "omit xfree86-dga"
EndSubSection
EndSection
Section "Device"
Identifier "Tegra"
Driver "tegra"
# OverlayDepth is a 32-bit integer which is used to control overlay
# stacking order. The overlay with the lowest depth is in front of
# all others. This value has meaning only when multiple overlays are
# present on a display.
# Option "OverlayDepth" "255"
# ARGBHWCursor controls whether the X driver uses an overlay to
# display 32-bit "true-color" cursors, or whether such cursors are
# emulated in software. Valid values are "true" to enable hardware
# cursors, and "false" (default) to disable them.
# Option "ARGBHWCursor"
EndSection
At the moment, I have looked through the config.tbz2 file and may have to stick the stuff in there into the tablet's linux filesystem. will test this later.
NOTE:
I am not a linux developer, I have no idea how to create linux drivers. All I can do is mash things together and hope things work out.
In theory, this should work for all tegra2 and tegra3 (using cardhu drivers instead of ventana) devices with some minor differences.
Edit:
Apparently it is using kernel version 2.6.38. I'm going to see if I can update the kernel to 3.2.23-1 which is the latest version for armhf in the debian package list (http://packages.debian.org/wheezy/kernel/linux-headers-3.2.0-3-all-armhf).
Edit2:
Looks like updating the kernel from apt-get doesn't necessarily enable the kernel to load as it seems that the boot loader loads a prepackaged kernel that has been flashed into mmcblk0p7. Tried out kexec and the kernel doesn't support it so adding it to the /dev/inittab script is useless for loading up new kernels. I tried making the new kernel into a flashable image using mkbootimg that is found within the Linux 4 Tegra folder but it doesn't do anything and the image apparently isn't valid when i tried booting it from fastboot (black screen). along with that, apparently it changed my password on my encrypted /data partition's password (when i flashed it within linux using dd) so a word of caution with that. If anyone can help me out, i would like to try to create something similar to grub (or even port it) where it loads up new kernels from the microsd or a specified place based on a boot list.
deb Files (Install using "dpkg -i acer-iconia-tab-a500+tegra+brcm+wheezy_<version>_armhf.deb" within the linux environment of the tablet.):
1.0-1: acer-iconia-tab-a500+tegra+brcm+wheezy_1.0-1_armhf.deb
--takes care of steps 9 and 11 sans hard linking the X11 tegra drivers.
1.0-2: acer-iconia-tab-a500+tegra+brcm+wheezy_1.0-2_armhf.deb
--has pre-depends for the first part of the wifi driver installation so this should, in theory, install both part 1 and 2 of the wifi drivers.
--takes care of steps 8, 9, and 11 sans hard linking the X11 tegra drivers.
Update log:
10/17/2012: added updated version of the deb package.
10/16/2012: first version.

Ok, so since I cant post anything including into ongoing threads in the android development forum due to the 10 post required thing i'll just have to ask development questions here till i reach the 10 post requirement.
Can anyone point me into the direction for how the second boot image that you flash for the dual boot bootloader is created? Trying to figure out how to create an image so that it boots everything off the microsd card including the kernel. It seems that the kernel used in the guide is locked to 2.6.38 and if you update the kernel within the tablet's linux environment it doesnt load it up. so i need to figure out how to create a boot image so that it loads it up or create a boot image that has grub (or other bootloaders) installed on it to boot different linux images.

alatnet said:
Ok, so since I cant post anything including into ongoing threads in the android development forum due to the 10 post required thing i'll just have to ask development questions here till i reach the 10 post requirement.
Can anyone point me into the direction for how the second boot image that you flash for the dual boot bootloader is created? Trying to figure out how to create an image so that it boots everything off the microsd card including the kernel. It seems that the kernel used in the guide is locked to 2.6.38 and if you update the kernel within the tablet's linux environment it doesnt load it up. so i need to figure out how to create a boot image so that it loads it up or create a boot image that has grub (or other bootloaders) installed on it to boot different linux images.
Click to expand...
Click to collapse
You are on the right track with mkbootimg. I have not figured it all out myself yet.
You have to compile your arm linux kernel then make a bootable image with mkboot
I don't know if you have seen this or if. this will help---Nethams kernel compile commands are;
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueable--j16
./mkbootimg --ramdisk dev/zero --kernel arch/arm/zimage -o ../recovery.img
I believe these are the commands he uses to compile his recovery image (boot.img)
It is my understanding that mkboot combines the kernel with a ram disk to make an image file that will boot the system
That image file can be placed in several places 1-primary boot position 2 recovery position 3 and if you have Skrilax dual boot secboot position
So it depends on what mkboot compiled as to what happens when that boot point is activated.
I am still trying to work out how Spdev and Netham combine or configure the kernel + initramfs+ ramdisk to create their bootable images.
I know these images boot and point to the file system which can be stored on internal or external sd card or even usb drive it all depends on how the boot image is configured.
Still learning myself
Here is a link I found explanes about Linux ram disk and initram
http://www.ibm.com/developerworks/linux/library/l-initrd/index.html
And more info here downloads a PDF presentation on how to.
http://www.google.com/url?sa=t&rct=...poCoAw&usg=AFQjCNHLTHE3DaroC71FAjOjQWU2A61qEQ
All about that mkbooting after you get your kernel
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

themechaniac said:
snip (freaking 10 post limit...)
Click to expand...
Click to collapse
Yea, i did find some stuff with mkbootimg including the last link that you posted.
The kernel was already compiled when i downloaded it using apt-get and it is placed in /boot folder.
I did make a boot.img from that kernel using mkbootimg and looking at "/proc/cmdline" at the arguments that were passed to the kernel in the other kernel image and it made it, flashed it to secboot and it didnt do anything except use the same kernal as before, though i did flash the image via dd in linux. Apparently this sorta screwed up my /data partition or something in where it wouldnt recognize my password for de-encryption to mount it. (fixing it by just erasing "/data" [bye bye data... TT.TT]) So i tried booting it using "fastboot boot <kernel>" and it didnt boot, only showing a black screen, but using the other boot.img it would boot linux up.
So I'm thinking of somehow creating a kernel image that can use kexec to make a grub like bootloader kernel that you flash onto the secboot partition that has something similer to grub.cfg in which you can easily select which kernel to load.
As for looking for a grub.cfg file, it would look in a few different places:
-in internal storage (probably recovery partition or the "/system" partition as the "/data" partition can potentially be encrypted and not mountable.)
-sd card (has to be in first partition and in fat32 format)
-usb drive (same as sd card)
from these places it will load each grub.cfg. that way it'll make the grub like bootloader kernel extendable in which kernel to load (i.e. have a linux system on usb that you want to boot from.)

I may be wrong but it is my understanding that the compiled kernel is in the boot image packed by mkbootimg.
The kernel is compiled to look for the compatible root file system in a particular place.
So when you change or use a boot image you change the kernel you are using.
So we have a system that;
Has a modified Linux kernel that selects the Android file system from internal memory installed in the first boot position.
We can put a Linux kernel compiled to find a compatible root file system say on external sd card in the second boot position.
We can replace the recovery image with a Linux kernel that finds a compatible root file system on the internal sd card.
That gives us a hardware selective three different systems (triple boot)
With fastboot on the PC we can quickly change any of the Three boot images, replace the recovery image or repair system.
I think all we need is a 3.2.23 kernel compiled thee separate ways and packaged with mkbootimg.
1st find root file system internel, 2nd find file system externel 3rd find file system usb
We already have two 2.6.38 kernels. One from Spdev (external root file system)and One from Netham {internal file system)
They are different kernels as Nethams has added modules.
I believe the were both compiled from the same Git.
I have tried switching the two boot images in second boot position with both root file systems installed and when you boot the second position
it switches to it's own file system.
I haven't tried swapping the root file positions yet.

themechaniac said:
I may be wrong but it is my understanding that the compiled kernel is in the boot image packed by mkbootimg.
The kernel is compiled to look for the compatible root file system in a particular place.
So when you change or use a boot image you change the kernel you are using.
So we have a system that;
Has a modified Linux kernel that selects the Android file system from internal memory installed in the first boot position.
We can put a Linux kernel compiled to find a compatible root file system say on external sd card in the second boot position.
We can replace the recovery image with a Linux kernel that finds a compatible root file system on the internal sd card.
That gives us a hardware selective three different systems (triple boot)
With fastboot on the PC we can quickly change any of the Three boot images, replace the recovery image or repair system.
I think all we need is a 3.2.23 kernel compiled thee separate ways and packaged with mkbootimg.
1st find root file system internel, 2nd find file system externel 3rd find file system usb
We already have two 2.6.38 kernels. One from Spdev (external root file system)and One from Netham {internal file system)
They are different kernels as Nethams has added modules.
I believe the were both compiled from the same Git.
I have tried switching the two boot images in second boot position with both root file systems installed and when you boot the second position
it switches to it's own file system.
I haven't tried swapping the root file positions yet.
Click to expand...
Click to collapse
Interesting. Though i think it needs to be a specific type of kernel (i.e bzImage or uImage instead of vmlinuz) to actually run. also, the precompiled kernel in the guide that i had used in the opening post had a command line where one option was "root=/dev/mmcblk1p2" which pretty much says for the kernel to look for the linux file system in the second partition on the sd card.

Yes with the way the system is formatted you cannot change out the kernel on the fly. It is basically hard coded in the boot image. Skrilax has given us a way to change boot positions so we don't have to sacrifice recovery position to boot second kernel. I have not seen any pre configured 3.2.23 kernels yet. The one that Netham posted boots from internal SD but causes problems for some people as not all a500 have their internal SD card formatted in the same memory block. It works great for me I prefer to have my root file system on a fast external SD so would like to modify or compile a kernel like Netham's. I find I run out of space when I have it internal. Netham's kernel has USB sound and seems to boot differt than Spdev's.

themechaniac said:
Yes with the way the system is formatted you cannot change out the kernel on the fly. It is basically hard coded in the boot image. Skrilax has given us a way to change boot positions so we don't have to sacrifice recovery position to boot second kernel. I have not seen any pre configured 3.2.23 kernels yet. The one that Netham posted boots from internal SD but causes problems for some people as not all a500 have their internal SD card formatted in the same memory block. It works great for me I prefer to have my root file system on a fast external SD so would like to modify or compile a kernel like Netham's. I find I run out of space when I have it internal. Netham's kernel has USB sound and seems to boot differt than Spdev's.
Click to expand...
Click to collapse
Right, but this is how the linux boot loader is going to go with, instead of loading the linux system (sans kernel and initrd) from the sd card, we create a boot.img that has a linux system built in that has a sole purpose of loading other linux systems using kexec.
Edit:
Here's how the path is going to go:
Startup-->Bootloader-->Linux Bootloader (loads linux on external drives)-->Linux (on external drives)

Well I am happy with Ubuntu on my external SD card, I even ran a kernel compile on it and it ran pretty fast. I am stuck on the mkbootimg part. It can't be done on the tablet, has to be a PC. I tried unpacking the Two ready made boot images to see how they are configured but they don't seem to have a ram disk. Still working on that. It is learning how the system is put together that is half the fun, Getting it to work the way you want is the goal. When it is all squared away it will be time to move on to the next puzzle. I have enough computers that I could just put a system on each one and be done with it. Where's the fun in that. Most of them are dual booted already.

themechaniac said:
Well I am happy with Ubuntu on my external SD card, I even ran a kernel compile on it and it ran pretty fast. I am stuck on the mkbootimg part. It can't be done on the tablet, has to be a PC. I tried unpacking the Two ready made boot images to see how they are configured but they don't seem to have a ram disk. Still working on that. It is learning how the system is put together that is half the fun, Getting it to work the way you want is the goal. When it is all squared away it will be time to move on to the next puzzle. I have enough computers that I could just put a system on each one and be done with it. Where's the fun in that. Most of them are dual booted already.
Click to expand...
Click to collapse
Well, even though mkbootimg is suppose to be run on linux, i don't think it was compiled for arm so you are going to have to use a pc for that program. as for the initrd, i did find a website that may help in creating an A.L.B.L. (Android Linux Boot Loader): http://www.thewireframecommunity.com/node/14
Essentially what is needed to create the A.L.B.L. is to create a kernel with kexec in it and an initrd that mounts the external drives along with an easy to use interface to be loaded before loading any kernels to allow for selecting kernels. with that said, how do you figure out how to use the volume buttons and the power button within linux using a c\c++ program?

BUMP!
any progress?
also
-Audio (Detects it in the kde info center. System Settings program only says that there's a dummy output. Playing any form of audio crashes the program.)
Click to expand...
Click to collapse
But
Code:
cat /any/file/for/ex/bin/bash > /dev/dsp
works properly

Unfortunetly no.
Been to busy with other stuff to work on this.

tegra driver
I have ubuntu 12.10 armf runing on my a500 thanks to the "Linux on A500: The Future" thread. I am using the ferrariforzaleo mod of rogro82's kernel.
The problem I had was getting the xorg tegra module to load. I fixed this by getting the "https://launchpad.net/ubuntu/quantal/armhf/nvidia-tegra/16.0-0ubuntu1"]https://launchpad.net/ubuntu/quantal/armhf/nvidia-tegra/16.0-0ubuntu1 and installing with
sudo dpkg -i
after I rebooted it started using the tegra video driver.
Cheers

HardlyAbelson said:
I have ubuntu 12.10 armf runing on my a500 thanks to the "Linux on A500: The Future" thread. I am using the ferrariforzaleo mod of rogro82's kernel.
The problem I had was getting the xorg tegra module to load. I fixed this by getting the "https://launchpad.net/ubuntu/quantal/armhf/nvidia-tegra/16.0-0ubuntu1"]https://launchpad.net/ubuntu/quantal/armhf/nvidia-tegra/16.0-0ubuntu1 and installing with
sudo dpkg -i
after I rebooted it started using the tegra video driver.
Cheers
Click to expand...
Click to collapse
can you explain me the steps you done ? I also want ubuntu 12.10 running but I can't install any desktop on it ( show error and other error )

ubuntu 12.10
Forzaferrarileo said:
can you explain me the steps you done ? I also want ubuntu 12.10 running but I can't install any desktop on it ( show error and other error )
Click to expand...
Click to collapse
Hi, I used the debootstrap and and qemu / chroot to setup my rootfs. i found post #61 in the "Linux on A500: future" very helpful.
Also, make sure you have a usb keyboard handy. After you run "apt-get install -d ubuntu-desktop" (assuming you have a pc running ubuntu to use) in a qemu chroot, you can move to the a500 and boot up and login as root and run "apt-get install ubuntu-destop". since the stuff is cached. I found this faster than installing the desktop while in the chroot. After that finishes, you should boot up with a desktop available. If something is wrong and you can't login, try doing "ctrl-alt-f1" to get to the getty command line login and look at the /var/log/ folder for clues in the logs.

How to compile the kernel?
I succesfully got debian running on my iconia a500 :laugh:
Building my own rootfs and getting the wifi to work were not that hard, but I still don't know how to compile the Linux kernel for the a500 from source.
I already found the git repository of rogru82 (https://github.com/rogro82/picasso-kernel) and I downloaded the source to my pc (running ubuntu 13.04). Can someone point me to a tutorial explaining how to compile this source?
Also, can someone explain what sort of partition table the internal memory uses? I am running the 3.0 kernel and I can see a block memory device in the /dev folder but there are no partitions. How can I mount the internal memory?

Related

[IDE] Build System for Boot Images v0.1 (Kernel, Ramdisk, Recovery Archive, ...)

Hi,
Because of the need of a bootmanager and the lack of patience to type a hack a lot at the console, I created a ubuntu maverick based build system for arm crosscompiling with a script helps by building kernel, ramdisk, recovery archive, debugging via fastboot and so on. As chroot env it is very flexible, needs not to install something and runs inside all linux distris.
just extract it somewhere onto an ext partition goto the directory and type ./start
in the root of the chroot env is a README file which contains infos where is what. read it before.
it contains three tools
build (a script supports different actions, "build help" shows them)
unpack-boot (extracts a boot image into the actual directory)
unpack-ramdisk (extracts a ramdisk into the actual directory)
Download:
http://www.bisme.net/files/xda/bootbs.tar.bz2
TODO:
the chroot env is still based on a desktop version of maverick and bigger than needed, this will change soon.
PS: Bootmanager is still in work, should finish(as a trivial but working version) in the next days and is the first step to support multiboot different linux installations(also different android versions) on android tablets. But this is another story will get an own Thread here. In the meantime I hope all romcookers out there will have fun with this build system.

Debian Squeeze on GT540

Hi,
I start this thread to speak about natively running Debian Squeeze on LG Optimus GT540.
I have put somme script to bootstrap complete installation on sdcard on :
poivron.org/~jimpulse/swift
Please read README first.
Kernel is 2.6.29 from lge source with minors modifications :
* lge source don't compile properly ( this is not what is distribute as binnary ?GPL violation? ).
* Framebuffer console on startup.
* Software refreshing enable.
* Race condition on mddi register function when using software refresher
* Inkernel command line.
* ext3fs
Kernel debian packages are in swift/kernel
the boot image is in swift/boot and is reconstruct at end of bootstrap.
Lxde environement with matchbox-window-manager and matchbox-keyboard is working fine for me.
Slim is used as display manager in autologin mode.
Freesmartphone is installed but not configured (TODO)
Wifi (4325) is working but module is not loaded on startup. The firmware is from lge source distribution but is the same as on binary distribution.
Bluetooth (?4325?) is not working. (blueman need dpkg --configure at first startup). (TODO)
Enjoy.
--
jim
i got: You don't have permission to access /~jimpulse/swift/README on this server.
You don't have permission to access /~jimpulse/swift/README on this server.
Says when i try to open README file
Sory, I"m noob !
Now, It's working.
I didnt understand how it's booting. What should i do. Just flash boot.img to recovery then boot from it? Is it enough or what should i do can you write it step by step?
Hi,
You must install debian on first partition of your sdcard.
The partition must be ext2 or ext3 formated (preferably ext3).
The script 'bootstrap.sh' is make for that, you have to be root to use it.
the card must be mounted with suid,dev,exec .
you must have installed somme packages on your host, read README file.
--
jim
hi there,
so its something like a dual boot ?
something like this http://forum.xda-developers.com/showthread.php?t=1408824.
Hi,
It is not dualboot by itself.
It is just a scritp to install Debian Squeeze armel on sdcard and build a boot image.
More explanation :
!!! Please, dont run the script if your dont understand what it do !!!
You have to edit the script to match your preference :
ROOT=<the target directory where to install to>
ROOTDEV=<Name of the device were your phone will look to find root filesystem>
This script is tested only on Ubuntu oneiric but should work on other debian-like distros.
You can format your sdcard like this : sudo mkfs.ext3 -L swift /dev/XXX
where XXX is the device file corresponding to the partition you want to format. You can figure out that by looking at kernel message after inserting the sdcard : dmesg
Eject and reinsert the card to mount the new filesystem.
Remount the filesystem with apropriate options : sudo mount -o remount,exec,suid,dev /media/swift (or wherether your filesystem is mounted).
So, change ROOT= variable as ROOT=/media/swift (or whatether ...)
and ROOTDEV=/dev/mmcblk0p1 (for the first partition of the sdcard)
Then run in the swift/ directory : sudo ./bootstrap.sh
If all is right, it take aprox 4 hours on my [email protected] to download and install everything.
After installation, you have choice to flash the boot rom (eg : sudo fastboot flash recovery /media/swift/boot/boot.img-2.6.29-swift) or to use it as chroot environnement from android.
jimpulse said:
Hi,
It is not dualboot by itself.
It is just a scritp to install Debian Squeeze armel on sdcard and build a boot image.
More explanation :
!!! Please, dont run the script if your dont understand what it do !!!
You have to edit the script to match your preference :
ROOT=<the target directory where to install to>
ROOTDEV=<Name of the device were your phone will look to find root filesystem>
This script is tested only on Ubuntu oneiric but should work on other debian-like distros.
You can format your sdcard like this : sudo mkfs.ext3 -L swift /dev/XXX
where XXX is the device file corresponding to the partition you want to format. You can figure out that by looking at kernel message after inserting the sdcard : dmesg
Eject and reinsert the card to mount the new filesystem.
Remount the filesystem with apropriate options : sudo mount -o remount,exec,suid,dev /media/swift (or wherether your filesystem is mounted).
So, change ROOT= variable as ROOT=/media/swift (or whatether ...)
and ROOTDEV=/dev/mmcblk0p1 (for the first partition of the sdcard)
Then run in the swift/ directory : sudo ./bootstrap.sh
If all is right, it take aprox 4 hours on my [email protected] to download and install everything.
After installation, you have choice to flash the boot rom (eg : sudo fastboot flash recovery /media/swift/boot/boot.img-2.6.29-swift) or to use it as chroot environnement from android.
Click to expand...
Click to collapse
I have done it for one time but it didn't boot So im gonna do it again tomorrow. I dont have time today
I'm always having problem with the script. Now im starting again. I hope it will done this time... And can you use a .35 kernel for this?
Hi,
I'm planning to include .35 kernel, but I dont know which one to use. I've start a thread to ask people there preferences. Kernel need minor modification to have frame buffer console working.
If you have probleme with the script, post last few line of output and I will try to help.
--
jim
I have the mismatch size problem with the one of xorg-bla-bla packages By the way Mikegapinski's kernel is good to work i think.
Edit:
And does this make a problem?
pre-installing dpkg
warning, in file '/var/lib/dpkg/status' near line 3 package 'dpkg':
missing description
warning, in file '/var/lib/dpkg/status' near line 3 package 'dpkg':
missing maintainer
Click to expand...
Click to collapse
These two warning are not a problem, these are only because dpkg/status is not complete before installing dpkg. It's a bootstrap edge effect (dpkg need dpkg to be installed).
If the script don't run until the end, you should have a phase number given at end of output. You can skip already ran phase by passing a phase number as parameter to the script.
The xserver-xorg-core problem is about dependencies against all video driver. So I mangle the control file to remove these dependencies. Perhaps this can fail if debian repo version has changed.
jimpulse said:
These two warning are not a problem, these are only because dpkg/status is not complete before installing dpkg. It's a bootstrap edge effect (dpkg need dpkg to be installed).
If the script don't run until the end, you should have a phase number given at end of output. You can skip already ran phase by passing a phase number as parameter to the script.
The xserver-xorg-core problem is about dependencies against all video driver. So I mangle the control file to remove these dependencies. Perhaps this can fail if debian repo version has changed.
Click to expand...
Click to collapse
Now i have bootedup but how can iload the wifi module now?
Hi,
The default password for root is root .
There is no sudo preinstalled so use su.
Firmware and nvram settings are in /etc/wl as for android names rte.bin and nvram.txt .
You have to pass parameters at load time :
modprobe wireless firmware_path=/etc/wl/rtecdc.bin nvram_path=/etc/wl/nvram.txt
or put this in /etc/modprobe.d/wireless.conf :
alias wlan0 wireless
options wireless firmware_path=/etc/wl/rtecdc.bin nvram_path=/etc/wl/nvram.txt
Wicd is not working correctly so you have to configure by hand
(iwconfig and ifconfig) or edit /etc/network/interfaces. (view debian administration guide for that).
I will update the script tomorrow to add a configuration file for modprobe and an alias to wlan0.
--
Jim
jimpulse said:
Hi,
The default password for root is root .
There is no sudo preinstalled so use su.
Firmware and nvram settings are in /etc/wl as for android names rte.bin and nvram.txt .
You have to pass parameters at load time :
modprobe wireless firmware_path=/etc/wl/rtecdc.bin nvram_path=/etc/wl/nvram.txt
or put this in /etc/modprobe.d/wireless.conf :
alias wlan0 wireless
options wireless firmware_path=/etc/wl/rtecdc.bin nvram_path=/etc/wl/nvram.txt
Wicd is not working correctly so you have to configure by hand
(iwconfig and ifconfig) or edit /etc/network/interfaces. (view debian administration guide for that).
I will update the script tomorrow to add a configuration file for modprobe and an alias to wlan0.
--
Jim
Click to expand...
Click to collapse
Thanks for these and how can i access the command line from my computer?
Hi,
Sorry, but I've forget to put openssh on package list. I'he also froget to add debian repo to sources.list .
Edit /etc/apt/sources.list with nano or vi and add a line with :
deb http://ftp.debian.org/debian/ squeeze main
then run apt-get update
You have to use the lxde terminal to configure wireless and install openssh-server (apt-get install openssh-server).
After that, you will be able to connect with ssh (ssh [email protected]<IP ADDRESS>) from your computer.
adbd is not working and need some tweak to work with debian.
--
Jim
Hi,
I've update bootstrap.sh :
* openssh-server and openssh-client are installed per default
* sources.list is now created durring bootstrap with same repo that the bootstrap process used.
* modprobe is configured to pass correct parameters to wireless module. There is also ans alias wlan0 ponting to wireless.
* network/interfaces is update to have the loopback interface configured at boottime. The configuration for wlan0 must be tweak for your network (essid, dhcp or static ...) .
Now, I'm working on 2.6.35 from wingrime and hope to publish it next week.
--
Jim
So, how is it going?
Sent from my GT540 using Tapatalk
jasper580 said:
So, how is it going?
Sent from my GT540 using Tapatalk
Click to expand...
Click to collapse
Yeah i wonder it too. I is so good to have debian on my phone. It'll be more usable with a touchscreen gui. It doesn't lag more. I think you should change the keyboard to a bigger. And we should can rotate screen. At least with running a sh file from terminal By the way you're great! I think this is gonna be awesome for our phones...

Ubuntu for N80xx

{
"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"
}
In addition to GNU/[email protected] topic, this one is a separate for Ubuntu users. Read below if you want to have native Ubuntu 13.10 wih Gnome/LDXE/XFCE at your Galaxy Note 10.1 device (2012 models only).
Screenshots:
Please be aware, that stuff I share with you is experimental, it does not work 100% correctly and there are some lags and bugs.
Some technical details:
The approach is based on using custom recovery (e.g. custom kernel and initrd image) which boots into Linux. All Linux files are stored at data partition (it is mmcblk0p12 when using standard firmware, which also is internal sdcard) in a separate folder. Initrd script mounts data partition and looks for the special file /media/rootdev - this file contains the path to the Linux root folder. Script sets the Linux root device to be this folder specified and invokes /sbin/init. You see Linux booting - Ubuntu in our case.
However I've also prepared the second folder with native recovery files. E.g. if you change rootdev content to point to recovery files folder, you will boot into recovery. Generally, you can boot any other recovery or Linux distro using this approach. And hosting it at sdcard in a folder much easier than re-partitioning tablet or using loop-device in a file. Free space for your Linux depends only of free space you have at data partition.
Prerequisites:
Rooted GT-N80xx device
Busybox tools installed
Desktop computer with ADB tools
Custom recovery image (with or without menu), native recovery, Ubuntu image files downloaded (see downloads section)
Understanding of what are you doing
Downloads:
Custom recovery image which boots to Linux (no menu) - recovery_nomenu.img
Custom recovery image which boots to Linux (with menu) - recovery_menu.img
Native recovery files archive - recovery.tar.gz
Ubuntu 13.10 files archive - ubuntu.tar.gz
Steps:
Connect your device to the desktop computer with USB cable. Make sure your device is visible when you run "adb devices"
Rename downloaded recovery image to "recovery.img"
Upload downloaded files to the internal memory:
Code:
adb push recovery.img /sdcard/
adb push recovery.tar.gz /sdcard/
adb push ubuntu.tar.gz /sdcard/
Now you need to get into device, so run "adb shell", then type the next commands (the lines beginning from # are the comments, you don't need to type it ):
Code:
# 4. become root user
su -
# 5. go to the internal sdcard real path, where you uploaded files
cd /data/media
# 6. write custom recovery to the special partition, by default it is mmcblk0p6
dd if=./recovery.img of=/dev/block/mmcblk0p6
# 7. unpack native recovery files, the "recovery" folder will be created
gunzip -c ./recovery.tar.gz | tar -x
# 8. unpack Ubuntu files, the "ubuntu" folder will be created
gunzip -c ./ubuntu.tar.gz | tar -x
# 9.1. Now, if you downloaded custom recovery without menu - set what to
# boot, in our case it is Ubuntu, and go to step #10
echo "/media/ubuntu" > ./rootdev
# 9.2. OR, if you downloaded custom recovery with menu - add menu entries
echo "Ubuntu=/media/ubuntu" > ./rootdev
echo "Recovery=/media/recovery" >> ./rootdev
echo "Reboot=reboot" >> ./rootdev
# 10. remove files that we don't need anymore and quit
rm ./recovery.img ./recovery.tar.gz ./ubuntu.tar.gz
exit
exit
Now you should reboot your device to recovery mode. If you did all correctly (and I did not miss anything in steps) you should see Linux booting (and menu if you are using custom recovery with menu).
Please use your S-Pen as mouse, button on the pen works as "right-click".
The password for root user and android user is "q" (small q-letter without quotes).
Notes:
The Ubuntu image I shared with you is v13.10 and Gnome-based (Unity does not work due to Compiz issues).
Regular Gnome session works at most, but have some bugs, due to 3D acceleration support issues. For example, window dragging does not work and the session hangs (sorry, I have not found why, please fix if you can and share your workaround with us).
Gnome Fallback works better, but might not start properly from the first time. E.g. you should boot to regular Gnome session, then log out and login to Fallback (also have no idea why it works like this, please help if have experience).
Due to the issues with Gnome, I've also installed LXDE and XFCE, so you could try login to it. However I would recommend booting to regular Gnome session at least to configure your Wi-Fi connection.
Internal and external sdcards are mounted to /mnt/intSdCard and /mnt/extSdCard paths.
Important notes:
The Ubuntu image has ADB installed. E.g. if something goes wrong at the screen and you are not able to manage your device, connect it to the desktop with USB cable, run "adb shell", then "sudo su -" and you become root user. To restart graphical session you need to invoke "service gdm restart" command.
If you are using custom recovery without menu and want to boot native recovery instead of Ubuntu, edit "rootdev" file at internal sdcard to contain "/media/recovery" path (without quotes). You can do that via ADB shell, using any Android text editor, or directly from Linux.
The last thing to know:
Not all is working from Ubuntu. Currently there is no 3G support and some other things. All of them are discussed in the parent thread
Please let me know if I have missed something and my steps do not work for you. Any other feedback will also be appreciated
downloading right now... just one question! can i do all this with terminal emulator on android?
edit: forget about that last question, tried from terminal emulator and it worked.
X-Stranger said:
In addition to GNU/[email protected] topic, this one is a separate for Ubuntu users. Read below if you want to have native Ubuntu 13.10 wih Gnome/LDXE/XFCE at your Galaxy Note 10.1 device (2012 models only).
Screenshots:
View attachment 2432486 View attachment 2432487 View attachment 2432488
Please be aware, that stuff I share with you is experimental, it does not work 100% correctly and there are some lags and bugs.
Some technical details:
The approach is based on using custom recovery (e.g. custom kernel and initrd image) which boots into Linux. All Linux files are stored at data partition (it is mmcblk0p12 when using standard firmware, which also is internal sdcard) in a separate folder. Initrd script mounts data partition and looks for the special file /media/rootdev - this file contains the path to the Linux root folder. Script sets the Linux root device to be this folder specified and invokes /sbin/init. You see Linux booting - Ubuntu in our case.
However I've also prepared the second folder with native recovery files. E.g. if you change rootdev content to point to recovery files folder, you will boot into recovery. Generally, you can boot any other recovery or Linux distro using this approach. And hosting it at sdcard in a folder much easier than re-partitioning tablet or using loop-device in a file. Free space for your Linux depends only of free space you have at data partition.
Prerequisites:
Rooted GT-N80xx device
Busybox tools installed
Desktop computer with ADB tools
3 files downloaded (see downloads section)
Understanding of what are you doing
Downloads:
Custom recovery image which boots to Linux - recovery.img
Native recovery files archive - recovery.tar.gz
Ubuntu 13.10 files archive - ubuntu.tar.gz
Steps:
Connect your device to the desktop computer with USB cable. Make sure your device is visible when you run "adb devices"
Upload downloaded files to the internal memory:
Code:
adb push recovery.img /sdcard/
adb push recovery.tar.gz /sdcard/
adb push ubuntu.tar.gz /sdcard/
Now you need to get into device, so run "adb shell", then type the next commands (the lines beginning from # are the comments, you don't need to type it ):
Code:
# 4. become root user
su -
# 5. go to the internal sdcard real path, where you uploaded files
cd /data/media
# 6. write custom recovery to the special partition, by default it is mmcblk0p6
dd if=./recovery.img of=/dev/block/mmcblk0p6
# 7. unpack native recovery files, the "recovery" folder will be created
gunzip -c ./recovery.tar.gz | tar -x
# 8. unpack Ubuntu files, the "ubuntu" folder will be created
gunzip -c ./ubuntu.tar.gz | tar -x
# 9. set what to boot, we want Ubuntu
echo "/media/ubuntu" > ./rootdev
# 10. remove files that we don't need anymore and quit
rm ./recovery.img ./recovery.tar.gz ./ubuntu.tar.gz
exit
exit
Now you should reboot your device to recovery mode. If you did all correctly (and I did not miss anything in steps) you should see Linux booting.
Please use your S-Pen as mouse, button on the pen works as "right-click".
The password for root user and android user is "q" (small q-letter without quotes).
Notes:
The Ubuntu image I shared with you is v13.10 and Gnome-based (Unity does not work due to Compiz issues).
Regular Gnome session works at most, but have some bugs, due to 3D acceleration support issues. For example, window dragging does not work and the session hangs (sorry, I have not found why, please fix if you can and share your workaround with us).
Gnome Fallback works better, but might not start properly from the first time. E.g. you should boot to regular Gnome session, then log out and login to Fallback (also have no idea why it works like this, please help if have experience).
Due to the issues with Gnome, I've also installed LXDE and XFCE, so you could try login to it. However I would recommend booting to regular Gnome session at least to configure your Wi-Fi connection.
Internal and external sdcards are mounted to /mnt/intSdCard and /mnt/extSdCard paths.
Important notes:
The Ubuntu image has ADB installed. E.g. if something goes wrong at the screen and you are not able to manage your device, connect it to the desktop with USB cable, run "adb shell", then "sudo su -" and you become root user. To restart graphical session you need to invoke "service gdm restart" command.
If you want to boot native recovery instead of Ubuntu, edit "rootdev" file at internal sdcard to contain "/media/recovery" path (without quotes). You can do that via ADB shell, using any Android text editor, or directly from Linux.
The last thing to know:
Not all is working from Ubuntu. Currently there is no 3G support and some other things. All of them are discussed in the parent thread
Please let me know if I have missed something and my steps do not work for you. Any other feedback will also be appreciated
Click to expand...
Click to collapse
Hi! What about the Source Code for your custom recovery and stuff?
Simon94 said:
Hi! What about the Source Code for your custom recovery
Click to expand...
Click to collapse
In ubuntu or debian:
Code:
apt-get install abootimg
abootimg -x recovery-1.img
After this you will have a folder with all the contents of the img. Some of which you can edit the scripts. You can extract the initrd and kernel even further with abootimg-unpack-initrd
i must say this is pretty awesome very few bugs, and xfce works perfect
Can't risk ruining my tablet until after the semester ends but as soon as it does I'll be trying this! Sounds awesome...
THANK YOU, and THANK YOU for returning! Note 10.1 is currently in hands of Samsung for repairs. Hopefully I can have some fun with this once it is back.
Please check drivers here: http://forum.xda-developers.com/showthread.php?p=45340017#post45340017
I think the driver for Mali acceleration may be possible (you are using Hardkernel from ODROID, correct?).
Simon94 said:
Hi! What about the Source Code for your custom recovery and stuff?
Click to expand...
Click to collapse
My latest kernel sources (arch branch) and toolchain (in the toolchain branch): https://github.com/X-Stranger/N8000
Kernel sources, patched video driver and other stuff: https://code.google.com/p/opensgn/
Recovery can be unpacked/fixed/repacked using abootimg tools as mentioned
dwegiel said:
THANK YOU, and THANK YOU for returning!
Click to expand...
Click to collapse
Don't forget to press "thanks" button (or even "donate to me" )
dwegiel said:
Note 10.1 is currently in hands of Samsung for repairs. Hopefully I can have some fun with this once it is back.
Please check drivers here: http://forum.xda-developers.com/showthread.php?p=45340017#post45340017
I think the driver for Mali acceleration may be possible (you are using Hardkernel from ODROID, correct?).
Click to expand...
Click to collapse
Yes, I'm using Mali acceleration in my Ubuntu image. It is still not 100% working though, that is what I'm talking about, when describe Gnome issues. If you can fix that - please do and share your experience, I'll update the image then.
I would also like someone to help with migration to the latest kernel, which has support for our Exynos board. Exception13 was going to do that, but looks like he is very busy person (and I can understand that).
Have composed a small menu program and added it to custom initrd. Now it is possible to select what to boot (see screenshot), e.g. don't need to edit rootdev file every time, only when adding new menu entry.
Updated first post of this topic with instructions how to get this.
X-Stranger said:
Have composed a small menu program and added it to custom initrd. Now it is possible to select what to boot (see screenshot), e.g. don't need to edit rootdev file every time, only when adding new menu entry.
View attachment 2436305
Updated first post of this topic with instructions how to get this.
Click to expand...
Click to collapse
This is fantastic news for Note 10 owners out-there. I never read about another tablet with a bootmenu to native linux and recovery, so Y'all are lucky to have X-Stranger on the case =] because also now the Ubuntu flavor is on the go.
For all you Note 8 owners out-there I am trying to port the images over with as few changes as possible but my skill level at this type of task is 1/10 that of X-Stranger, so bare with me! (Or you can try and get a package together faster than me =] ).
My process so far is to use the initrd from X-Stranger's recovery_menu.img, and use a zImage from CWM, TWRP, and stock. All that they do is loop back to the note's defalt splash screen. I used X-Stranger's entire recovery_menu.img too and it boots to just a black screen on the Note 8. So my WIP conclusion thus far is that I or someone (volunteer required) has to compile a kernel with some patches just like X-Stranger did on page 3 of the previous thread.
Enjoy Ubuntu all the Note 10 owners....
at the first boot it says "failed to mount extsdcard, press S to skip ....." of course there's nothing to press anything on. I guess it's because my 64gb microsd is ntfs formated. Should I convert it to exfat from windows, should I attach a usb keyboard with OTG and press s?
Sent from my GT-N8013 using Tapatalk
Anyone tried this on the n8020?
I cant get it to work.
Nothing happens
Edit: Wrong recovery partition...for me it is mmcblk0p9
I'm having the same the same issue as panoz, error mounting /mnt/extSdCard. Also tried removing it before boot, but it complains that there's nothing to mount. I only have a Bluetooth keyboard, no otg, so is my only option to format the card?
Btw thanks X-Stranger and all the devs involved for all your work!!
panoz said:
at the first boot it says "failed to mount extsdcard, press S to skip ....." of course there's nothing to press anything on. I guess it's because my 64gb microsd is ntfs formated. Should I convert it to exfat from windows, should I attach a usb keyboard with OTG and press s?
Sent from my GT-N8013 using Tapatalk
Click to expand...
Click to collapse
Yes, it is expecting FAT to be mounted. As a workaround you can disable ext sdcard mounting. Just go to ubuntu image directory, etc folder, find fstab file and comment out the line related to external sdcard (put # symbol in the beginning).
emptynick said:
Anyone tried this on the n8020?
I cant get it to work.
Nothing happens
Edit: Wrong recovery partition...for me it is mmcblk0p9
Click to expand...
Click to collapse
Didn't know n8020 has recovery partition different. Is data partition the same? Or also differs? Did you finally get it working or still need help?
X-Stranger said:
Didn't know n8020 has recovery partition different. Is data partition the same? Or also differs? Did you finally get it working or still need help?
Click to expand...
Click to collapse
Userdata is mmcblk0p16.
It starts to boot but tells me that the path "new_root/linux" and "new_root/ubuntu" couldn't be found.
I read about it recently, but dont know where anymore
What im mostly curious about right now are the bugs you talked about. Are they comparable to the archlinux ones? Worse? Better?
Does it have mali hardware accel?
Does the entire thing crash after a while?
Does the img itself get corrupted every few boots?
Wifi works fine?
Sorry for the barrage, but these are important for me to know before i make the switch
Sent from my Nexus 4 using xda app-developers app
emptynick said:
Userdata is mmcblk0p16.
It starts to boot but tells me that the path "new_root/linux" and "new_root/ubuntu" couldn't be found.
I read about it recently, but dont know where anymore
Click to expand...
Click to collapse
Okay, in your case I need to fix recovery partition to look for mmcblk0p16 instead of mmcblk0p12 in my case. Please send me your email, I'll generate and send special version for you to try fixing that.
younix258 said:
What im mostly curious about right now are the bugs you talked about. Are they comparable to the archlinux ones? Worse? Better?
Click to expand...
Click to collapse
This really depends. I would say that it is the same. The bugs I'm talking about: the graphics may hang it you try to move window in Gnome for example, but works perfectly in Gnome Fallback. You should give it a try.
younix258 said:
Does it have mali hardware accel?
Click to expand...
Click to collapse
Yes, it has the same accel that ArchLinux has. But after summer upgrades Gnome did not want to work in ArchLinux and I was not able to fix that. That is why there is no new ArchLinux images.
younix258 said:
Does the entire thing crash after a while?
Click to expand...
Click to collapse
Have not faced this yet.
younix258 said:
Does the img itself get corrupted every few boots?
Click to expand...
Click to collapse
Nope. There I use new approach without img. All the files are stored and the data partition and it is fsck-ing every boot. Even more - it is easier to have Ubuntu and ArchLinux together. I just need to to prepare the Arch files folder for you when have free time. Or you can do it by yourself.
younix258 said:
Wifi works fine?
Click to expand...
Click to collapse
WiFi works the same. The only thing is better - it does not require to off/on to start seeing hotspots.

Natice Linux Installation No Android

As anyone who has tinkered around with android and linux will know there are tons of different security mechanism in place or even general lacks of features that dissallow the ability to start linux on boot instead of android. One of the features that will make booting our own OS easier is the use of RAM-Disk.
First we must consider the way that Android boots when we turn on our devices currently, The system powers on and depending on button combination or system state the bootloader decides where to start booting. In the case of my Samsung SM-T520 this means that I have 2 partitions that I can access in order to interrupt the Android boot sequence and boot instead into an OS of my choosing. Those two partitions are Labelled as Boot and Recovery and reside at /dev/block/mmcblk0p9 and /dev/block/mmcblk0p10, but it is not as simple as simply mounting the partition and modifying the contents, we have to Modify the stock Kernel as well a little bit to be able to achieve better performance in the Linux side of things.
In the case of the SM-T520 I have compiled a preconfigured Kernel for this and will upload it below, But for those of you who do Not have the SM-T520 I will upload a sample Kernel config that you can base your own off of.
That settles the Kernel side of things but there is still 1 other part missing, If we just modify the Kernel then we are really not making any difference so we must edit...
The Initial RAMDISK
The Initramfs as many know it is glued to the back end of our kernel zImage that we get from compiling our own kernel, and includes a few small files to set up the initial environment for Android, or our Guest OS to finish booting from. This means that we have a pretty good base to start out with booting Linux. We simply have to grab this base and modify to our will.
So to start I took an image of /dev/block/mmcblk0p9 using dd from recovery like so ‘dd if=/dev/block/mmcblk0p9 of=sdcard/mmcblk0p9.img’ and copied the file onto my linux development machine. I then used umkbootimg passing the file to it as input in order to deconstruct that file into the zImage and the Ramdisk. i then copied the Ramdisk which will be in a file called initramfs.cpio.gz into a new folder on my computer and ran unpack_ramdisk on it to get to the nitty gritty inside which is what we need. and i promptly threw out the old initramfs.cpio.gz and kept only the ramdisk folder. This allowed me to modify the “scripts” inside of it so that it would boot Linux by mounting the linux install location as / then telling if to boot using the init function that linux already has. while I was testing i decided to leave the android install mounted essentially, what that means is that the android install hides away in the filesystem inside the linux install if we ever want to boot Android into a chroot Jail of its own.
That is possible because Android’s file system and the linux filesystem being used are the same structure, but at different locations /system being empty for the Android system to occupy. This is all fine, but where do we put linux? The short answer, Wherever the heck ya want to!
My answer was to put the linux install onto my MicroSD card at /dev/block/mmcblk1p1 so that i could write an addition to the logic inside the Ramdisk to start linux or android based on whether the SD card was inserted at boot.
More yet to follow
Interesting read. It will be great to see where this leads.
Very interesting. If this develops in would love to test.
Hei @DJHenjin1 , any update on this? I would love to see ubuntu running native on my SM-T520, especially now that it is sure we are not going to get any firmware update. Anyway, nice job! Thanks

[Guide] Linux on the Nexus 9

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.

Categories

Resources