FORUMS
Remove All Ads from XDA
Honor View 10
Win an Honor 7X!

[Q&A] How to build/modify your own linux image for eMMC install Debian sample inside

157 posts
Thanks Meter: 61
 
By shaola, Senior Member on 2nd February 2012, 12:01 PM
Post Reply Email Thread
This thread is for help and support with all linux distributions instalable in eeepad asus transformer. I will explain how to build your own image file or modify existing one in order to use lilstive OLife script.

As ubuntu is the most popular distro, please, all de questions related with ubuntu post them in lilstevie's thread.

You can install any distribution with arm architecture support, but you'll need to make some tweaks in the image in order to work propperly. As my experience in linux is most of it related with debian is the distro i will give the best support, but i'll try to answer every question you ask.

I've chosen debian armHardFloat port instead of debian armel fore many reasons, you can read about this port here:
http : //wiki. debian.org/ArmHardFloatPort

This port is still young so right now there are packages still unaviable to install but they are entering in wheeze day to day. If you preffer to use armel instead or armhf you can always do, you will loose improvement but you will have (at the time of writting this) less packages aviable. In the future (not far away) it will be the best option.


Building your own image:
There are many ways to create a image file but because we are going to need qemu in order to debootstrap the instalation the easiest way to create it is with qemu-img

Code:
qemu-img create debian-armhf.img 400M
I have only given 400M of space because is going to be a minimal instalation without desktop enviroment, it could be smaller but, just in case, that's the size i've chosen. The transfer with OLife it will be faster if the image is smaller.

When you boot for your first time you will find an error because there is no valid MSDOS partition table, this is ok, nothing happens because of that but if you want to avoid it use fdisk to create a partition table

Code:
fdisk debian-armhf.img
we need now to give format to the filesistem:

Code:
mkfs.ext4 debian-armhf.img
It will ask if you really want to do because it's not an ordinary partition and you have to type "s" to proceed

Now whe have ready the image and we have to mount it in some folder to install debian in it:

Code:
mount -o loop debian-armhf.img debian
asuming debian as the created folder for that.

We are ready to debootstrap de instalation:

Code:
debootstrap --verbose --arch armhf --foreign --include=btrfs-tools,locales,kbd,wpasupplicant  wheezy  debian http://ftp.de.debian.org/debian
this will make the first step to install wheezy armhf, --foreing parameter is because the target architecture is different from the host one and it's going to stop before de second-stage, it will include the packages btrfs-tools locales and kbd, you can add as many as you want but it will be always faster if you install them manually once installed in the transformer. I didn't install ssh server because i have a dock, but if you don't have it will be needed to complete the instalation with a remote shell, but you can also install packages later with chroot after the second stage.

In order to be able to chroot we will need qemu-user-static, with armhf it's needed 1.0 version with armel it's not necesary, it can be any version not too old. Also if you have an i386 system it's recomendable to install an amd64 kernel to do chroot or debootstrap will fail configuring cron. Actually i think in this sample image there is anacron instead of cron because there was an issue i thought it was related with that but later twb found out the problem was another different and now it's solved.

we will add qemu-arm-static to the instalation to be able to chroot


Code:
cp /usr/bin/qemu-arm-static debian/usr/bin/
we chroot to the new enviroment:

Code:
chroot debian
and execute the second stage of debootstrap:

Code:
./debootstrap/debootstrap --second-stage
After finish the instalation we will set the root password

Code:
passwd
and now it's ready, you can make tweaks, install packages (as ssh if you need it) or whatever you want, but you will have to add a repository to /etc/apt/sources.list in order to install any packages.

In this image and debootstrap proccess i've used german repositories because are the fastest for me, but you can use another one, right now it's neede also experimental repository to have working touch screen, but as soon xserver-xorg-input-evdev with full multitouch support enters sid as it won't be necesary

example of /etc/apt/sources.list
Code:
http://ftp.de.debian.org/debian unstable main contrib non-free
http://ftp.de.debian.org/debian experimental main contrib non-free

I have already installed in this image necesary packages for that and experimental repositories won't interfiere unless you pass the parameter for apt-file so you can forget about this if you want, but if you are building your own image apt-get install -t experimental xserver-xorg will do the work.

we have ready now our image but it need some files and tweaks to make everithing work in the eepad.

From here you can apply this to any arm image you want to test.

(all the files needed are in the attached file files.tar.gz in the rigth folders)
we need to add modules and firmware, i've extracted them from lilstive ubuntu.img
strictly necesary are:

Code:
/lib/firmware/nvram.txt
/lib/firmware/brcm/*
but you may need another ones if you are going to use external hardware, that's on you.
there are also two folder in /lib/modules one is for the asus kernel and the other one for chrome os kernel, i suggest to add both of them because it's just a bit space and you will be able to use the image with both kernels.

In order to make wifi work i've made /etc/modprobe.d/options.conf file with some parameters found in one of the threads of lilstevie and /etc/modules with the modules to load.

You will also need to configure /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf all this files are in the attached files.tar.gz but wpa_supplicant.conf is not because it depends of each ones wifi, but there is a wpa_supplicant.conf.example and you can always google for it a bit. If you don't have a dock make sure you do this correctly or you won't be able to connect to the internet and ssh device to continue instalation easily


if you want to be able to use adb (wich is really usefull if you for example did not correctly configure wpa_supplicant) you will have tu add also "/usr/bin/adbd" and /etc/init.d/adbd"

I've modify the original init.d script to avid LSB tags missing warning error, it's not really necesary rsyslog as previous service started but ... it works.

In order to make adb service start automatically we will execute (inside the chroot of course)

Code:
update-rc.d /etc/init.d/adb defaults
This may be different in non debian based distributions, but you can always ln manually to rcX.d

Finally, there is the "bug" it has made me think something was wrong and change cron with anacron, when you boot it appears to stop booting starting a service (cron, dbus, deppending what you have installed) but it isn't you can login pressing ctrl + alt + F2 (touchpad key),
we think it's related with the bootloader and default tty as 7 or something like that.

As workaround add in /etc/rc.local "chvt 1" (without quotes) just before exit 0 line


Because there is not oem-installation like in ubuntu after the first boot there are a couple of things to do, we have to resize the image to fit the partition, change password, configure locales and xorg keyboard-layout (if you have more than one locales) add an user and include in relevant groups and maybe more in the future so i've made a postinstalation.sh script included in /usr/bin:
Code:
#!/bin/sh
echo "Making online resize of the root partition"
partition=`mount -l | grep " / " | awk '{print $1}'`
resize2fs $partition
echo "changing root password"
passwd
echo "configure locales"
dpkg-reconfigure locales
echo "configure xserver keyboard layout"
dpkg-reconfigure keyboard-configuration
echo "configure localtime"
dpkg-reconfigure tzdata
echo "Please anter a user name"
read username1
adduser $username1
echo "adding user to relevant groups"
adduser $username1 audio
adduser $username1 video
adduser $username1 netdev
adduser $username1 plugdev
adduser $username1 bluetooth
adduser to bluetooth will fil because there is not installed any bluetooth manager so there is not bluetooth group yet, and remeber tu use OLife script to inject bluetooth firmware in order to have bluetooth working.

And that's it i think i haven't miss anything but i will update this when needed. You can now install your image with lilstevie's OLife script, you will have to rename it to ubuntu.img from now. If everithing went ok you can now install the desktop enviroment you prefer, on screen keyboard or whatever you like.

I haven't test network manager and i've only tested kde-netbook, but there are still broken dependencies and it's a bit slow. This will improve as soon as we have hardware acceleration (if we ever do), and armhf port goes ahead.


Lilstevie is going to host my images and maybe OLife script will have more options in the future, but from now you can download from here:

http://dl.dropbox.com/u/60048492/deb...mhf.img.tar.gz

(md5sum inside)

http://dl.dropbox.com/u/60048492/files.tar.gz

All credits and many thanks for lilstevie and twb for all the help they gave me.

I will apreciate any correction not only in this process but also in my english grammar/ortography
The Following 8 Users Say Thank You to shaola For This Useful Post: [ View ] Gift shaola Ad-Free
 
 
2nd February 2012, 12:06 PM |#2  
shaola's Avatar
OP Senior Member
Thanks Meter: 61
 
More
Please, any mod or admin can correct the word modufy in the title?
reserved
7th February 2012, 05:58 AM |#3  
Junior Member
Thanks Meter: 0
 
More
Thanks
Following your instructions, I can finally replace ubuntu with debian, which resides my home laptops, office desktop, and now, on my tablet as well. Unfortunately debian has no "onboard" package... and it's rather inconvenient without a dock.

Thanks anyway for bring debian to this tablet.
7th February 2012, 09:52 AM |#4  
shaola's Avatar
OP Senior Member
Thanks Meter: 61
 
More
Quote:
Originally Posted by boseliquid

Following your instructions, I can finally replace ubuntu with debian, which resides my home laptops, office desktop, and now, on my tablet as well. Unfortunately debian has no "onboard" package... and it's rather inconvenient without a dock.

Thanks anyway for bring debian to this tablet.

What has onboard that haven't other onscreen keyboards? i haven't ever tried onboard and i just tried a couple of onboard keyboards in debian, i also did managed to load it automatically in login screen, But i did never went deeper, like "only appear if the focus is in textbox" or something like that.



Anyway i has to be easy to rebuild that package for debian or just install it from ubuntu. What do you exactly need?
8th February 2012, 11:54 AM |#5  
Junior Member
Thanks Meter: 0
 
More
onboard onboard
Onboard has keys that simulate middle-click and right-click of mouse. I tried to install ubuntu's deb file, but runs into problem with dependencies. Compiling the source on the tablet led to error related to gdk/gdk.h which i couldn't figure out how to resolve.

Onboard respond better than others, e.g. xvkbd and florence both have run-away key presses, i.e. a string of letters appear even for a quick single tap on a key.

Also, onboard integrates nicely with lightdm. I used xdm plus florence to log in (the screen keyboard hides most of xdm's GUI).

With fluxbox, debian seems faster than ubuntu+fluxbox on the tablet. That's why onboard is nice since fluxbox menu requires right-clicking on the desktop. Fortunately, fluxbox keys are easily configurable, so i still can shutdown by pressing some key combination.

Hopefully lilstevie has the time to work on hardware acceleration, which would then allows to dump android completely.
8th February 2012, 11:56 AM |#6  
shaola's Avatar
OP Senior Member
Thanks Meter: 61
 
More
Quote:
Originally Posted by boseliquid

Onboard has keys that simulate middle-click and right-click of mouse. I tried to install ubuntu's deb file, but runs into problem with dependencies. Compiling the source on the tablet led to error related to gdk/gdk.h which i couldn't figure out how to resolve.

Onboard respond better than others, e.g. xvkbd and florence both have run-away key presses, i.e. a string of letters appear even for a quick single tap on a key.

Also, onboard integrates nicely with lightdm. I used xdm plus florence to log in (the screen keyboard hides most of xdm's GUI).

With fluxbox, debian seems faster than ubuntu+fluxbox on the tablet. That's why onboard is nice since fluxbox menu requires right-clicking on the desktop. Fortunately, fluxbox keys are easily configurable, so i still can shutdown by pressing some key combination.

Hopefully lilstevie has the time to work on hardware acceleration, which would then allows to dump android completely.

Ok, i'll give it a look and if i can i will build a debian package in order to include it in the image
8th February 2012, 06:06 PM |#7  
shaola's Avatar
OP Senior Member
Thanks Meter: 61
 
More
I've managed to build a couple of packages for onboard. You can't imagine how much crap it's in building dependencies, mono, unity and so many things, so i've removed appindicator dependency because i don't think it's going to be really necesary. The true is that i don't have so much time right now so,

Can you please test it and tell me if you have any problem? I can try to rebuild another older version in order to avoid unity crap and those things without messing the code, but if this works well it's the eassiest solution.

You have to install both packages, the other dependencies are instalable from debian oficial repository, at least i haven't got any problem installing it in my building environment.


http://dl.dropbox.com/u/60048492/onb...95.1-1_all.deb
http://dl.dropbox.com/u/60048492/pyt....0-1_armel.deb
The Following User Says Thank You to shaola For This Useful Post: [ View ] Gift shaola Ad-Free
9th February 2012, 08:59 AM |#8  
Junior Member
Thanks Meter: 0
 
More
arch of python-virtkey is armel instead of armhf
Almost there... but obtained the following error msg:

Unpacking onboard (from onboard_0.95.1-1_all.deb) ...
dpkg: dependency problems prevent configuration of onboard:
onboard depends on python-virtkey (>= 0.60.0); however:
Package python-virtkey is not installed.
onboard depends on python-gconf; however:
Package python-gconf is not installed.
dpkg: error processing onboard (--install):
dependency problems - leaving unconfigured

Thanks again.
9th February 2012, 09:19 AM |#9  
shaola's Avatar
OP Senior Member
Thanks Meter: 61
 
More
Quote:
Originally Posted by boseliquid

Almost there... but obtained the following error msg:

Unpacking onboard (from onboard_0.95.1-1_all.deb) ...
dpkg: dependency problems prevent configuration of onboard:
onboard depends on python-virtkey (>= 0.60.0); however:
Package python-virtkey is not installed.
onboard depends on python-gconf; however:
Package python-gconf is not installed.
dpkg: error processing onboard (--install):
dependency problems - leaving unconfigured

Thanks again.

python-virtkey is provided in my previous post, just install it, after that

#apt-get install -f

will resolve and install automatically pending dependencies.

I've already tried and it works.

EDIT: i have been working in the suppose you are runnin debian armel and not armhf
21st June 2012, 12:16 PM |#10  
Senior Member
Thanks Meter: 97
 
More
To get bluetooth working, you need an armhf build of brcm_patchram_plus.
Thankfully it's GPL'd, so here's a copy.
Attached Files
File Type: gz brcm.tar.gz - [Click for QR Code] (19.3 KB, 157 views)
10th July 2012, 03:24 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Hi,

I'm having a bit of trouble getting Debian on my TF101 using OLiFE.

I'm forced to use the android/Ubuntu dual-boot option, but that's another story.

Basically, there's a kernel panic and I can't see the entire screen without it rebooting one second later. I am able to flash my TF101 properly without bricking (it's a B60), but everytime I boot it up as my default OS, I get that rebooting screen.
Post Reply Subscribe to Thread

Tags
debian, linux, native, transformer

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread