FORUMS
Remove All Ads from XDA

[ROM] Native Ubuntu on the Epic!

149 posts
Thanks Meter: 209
 
By DrGit, Senior Member on 6th April 2012, 05:48 AM
Post Reply Email Thread
I got Ubuntu 13.04 to boot cleanly on my Epic! No chroot or VNC hacks involved!
This method loads a custom kernel using kexec and runs off a microSD card.

Check the end of the post for the kernel config and patches, xorg.conf, /etc/modules, the kexec zip, and a pre-built kernel.
I may eventually provide a pre-built root filesystem, but for now it's easy enough to build your own.
For the technically inclined, Debian, Arch Linux, MeeGo/Mer/Nemo/Tizen, Fedora, Gentoo, Slackware, and a few other distros should also work with this method.

Working as of March 30, 2013:
* Touchscreen, 10-point multitouch!
* Unaccelerated X11 with fbdev, framebuffer console disabled for cleaner boot.
* Charging, battery meter
* WiFi
* Sound! NB, the hack I used to get it working disables the codec shutdown sequence, which could affect battery life and prevent the phone from sleeping.
Partially working:
* Keyboard (incomplete layout; not sure what to do with Fn/3rd level key mapping)
* Cameras (recognized as V4L2 devices but VLC complains with "invalid pixel format" so the drivers probably need fixing)
* Sensors/autorotate (sensors recognized in kernel/X11/SDL, I'm working on auto rotation)
Not tested:
* Bluetooth
* GPS
* Calls/data: https://github.com/morphis/libsamsung-ipc

Step by step guide!

PREREQUISITES:
* An Epic 4G with a custom recovery and a microSD card. 2GB free space on the card recommended.
* A Linux computer. Sorry, Windows/Mac users, you're on your own.

Step 0: Get the files you need
Extract the contents of linux_epicmtd.zip to a new folder somewhere and change to that folder in your terminal.

Step 1: Partition your SD card
Please backup of the contents of your SD card before doing anything else.
You can do this by mounting USB storage, but I prefer to remove the card and put it in a USB card reader, that way it's harder to accidentally disconnect it and corrupt data.
What you want to do is shrink the FAT partition from a computer by 2GB and create a new ext2/4 partition out of that free space.

2GB should more than suffice for a minimal Ubuntu install, but if you intend to install Unity (ubuntu-desktop) or other big packages, you may need anywhere from 2GB to 4GB, or possibly more. Resize accordingly.

The following instructions assume the Linux partition you just created is labeled "Ubuntu" and the FAT partition you resized is labeled "microSD". If you don't label them, your mount points will be different.

Step 2: Install Ubuntu on the second partition
Code:
# Assumes your new Ubuntu partition is mounted at "/media/$USER/Ubuntu"
wget http://cdimage.ubuntu.com/ubuntu-core/daily/current/raring-core-armhf.tar.gz
tar xvf raring-core-armhf.tar.gz -C /media/$USER/Ubuntu
Step 3: Configure the filesystem
Code:
# to chroot into the ARM rootfs on a non-ARM computer:
sudo apt-get install qemu-user-static
sudo cp /usr/bin/qemu-arm-static /media/$USER/Ubuntu/usr/bin
sudo mount -o remount,dev /media/$USER/Ubuntu
sudo chroot /media/$USER/Ubuntu
# check /etc/apt/sources.list and make sure universe is enabled
apt-get update
apt-get dist-upgrade
# select your preferred desktop environment
apt-get install {k,x,l,}ubuntu-desktop e17 gnome-session-fallback plasma-active
adduser yournamehere
usermod -a -G audio yournamehere
passwd yournamehere
tzselect
# do anything else you want to do, exit the chroot, then run the following commands from your working folder:
sudo cp X11.txt to /media/$USER/Ubuntu/etc/X11/xorg.conf
sudo cp modules.txt /media/$USER/Ubuntu/etc/modules
adb pull /vendor/firmware/fw_bcmdhd.bin
adb pull /system/etc/wifi/nvram_net.txt
sudo cp fw_bcmdhd.bin nvram_net.txt /media/$USER/Ubuntu/lib/firmware
Step 4: Install the kernel, copy the kexec zip to your SD card, and boot!
Option 1: Use my pre-built kernel.
Code:
cp zImage /media/$USER/microSD
sudo tar xvf modules.tar.gz -C /media/$USER/Ubuntu
cp boot_zImage.zip /media/$USER/microSD
Option 2: Build the kernel from source.
Code:
sudo apt-get install build-essential git gcc-arm-linux-gnueabi libncurses5-dev
git clone git://github.com/CyanogenMod/android_kernel_samsung_epicmtd
cd android_kernel_samsung_epicmtd
git checkout cm-10.1
git apply ../linux_epicmtd.patch
export CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
cp ../epicmtd_defconfig.txt .config
# make menuconfig if you want to enable the framebuffer console or customize anything
make -j8
sudo make modules_install INSTALL_MOD_PATH=/media/$USER/Ubuntu ARCH=arm
cp arch/arm/boot/zImage /media/$USER/microSD
cd ..
cp boot_zImage.zip /media/$USER/microSD
Reboot into recovery, install zip from sdcard, select boot_zImage.zip, and enjoy your new Ubuntu installation!
Attached Files
File Type: zip linux_epicmtd.zip - [Click for QR Code] (3.54 MB, 113 views)
The Following 13 Users Say Thank You to DrGit For This Useful Post: [ View ] Gift DrGit Ad-Free
 
 
6th April 2012, 05:51 AM |#2  
gooch1025's Avatar
Senior Member
Thanks Meter: 267
 
Donate to Me
More
First! Very excited for this. Any screens available?

Sent from my Tangerine Dream Epic 4G using xda premium
6th April 2012, 06:14 AM |#3  
ÜBER™'s Avatar
Recognized Themer
Flag Texas
Thanks Meter: 8,957
 
Donate to Me
More
Hmm can get my phone working on linux pretty flawlessly but my laptop just doesn't like it go figure. Anyways those are my issues [ would be cool if I could find someone to help me with my linux issues] but anyways this is pretty sweet .

Sent from my SPH-D700 using xda premium
6th April 2012, 07:18 AM |#4  
xopher.hunter's Avatar
Senior Member
Ventura
Thanks Meter: 393
 
More
Wow, did not see this coming! Gonna attempt this weekend. Awesome work

Sent from my MIUI V4 Epic 4G via Tapatalk 2 beta 5
The Following User Says Thank You to xopher.hunter For This Useful Post: [ View ] Gift xopher.hunter Ad-Free
6th April 2012, 12:26 PM |#5  
Senior Member
Thanks Meter: 45
 
More
How is 12.04 for PC in its current state? I'm on 11.10 and I would consider switching, if it wasn't buggy and what not.

Sent from my SPH-D700 using XDA
6th April 2012, 12:45 PM |#6  
MДЯCЦSДИT's Avatar
Inactive Recognized Developer
Thanks Meter: 4,636
 
More
Quote:
Originally Posted by tdwp16

How is 12.04 for PC in its current state? I'm on 11.10 and I would consider switching, if it wasn't buggy and what not.

Sent from my SPH-D700 using XDA

In my honest opinion, Ubuntu sucks since the 9.x days. I would try out the gnome version of LMDE (Linux Mint Debian Edition). You will never want to go back.

Sent from my SPH-D700 using Tapatalk
The Following 3 Users Say Thank You to MДЯCЦSДИT For This Useful Post: [ View ] Gift MДЯCЦSДИT Ad-Free
6th April 2012, 01:01 PM |#7  
Senior Member
Thanks Meter: 45
 
More
I tried out the last Linux mint. I kept having problems with the music player freezing my computer. idk how but that's the only thing that did it. So I switches back yo Ubuntu after using mint for a year or two and just loaded gnome shell.

Sent from my SPH-D700 using XDA
6th April 2012, 01:17 PM |#8  
MДЯCЦSДИT's Avatar
Inactive Recognized Developer
Thanks Meter: 4,636
 
More
Quote:
Originally Posted by tdwp16

I tried out the last Linux mint. I kept having problems with the music player freezing my computer. idk how but that's the only thing that did it. So I switches back yo Ubuntu after using mint for a year or two and just loaded gnome shell.

Sent from my SPH-D700 using XDA

LMDE is very different from the old mint.

Sent from my SPH-D700 using Tapatalk
6th April 2012, 01:26 PM |#9  
Senior Member
Thanks Meter: 45
 
More
I'll try it just because you said so marc. I'll just make another partition for it and play with it. If I like it I'll deff let you know.

Sent from my SPH-D700 using XDA
6th April 2012, 03:09 PM |#10  
beltsnspoons's Avatar
Senior Member
Dayton, Ohio
Thanks Meter: 80
 
More
Quote:
Originally Posted by tdwp16

I tried out the last Linux mint. I kept having problems with the music player freezing my computer. idk how but that's the only thing that did it. So I switches back yo Ubuntu after using mint for a year or two and just loaded gnome shell.

Sent from my SPH-D700 using XDA

weird, i had the EXACT same issue with my last debian install. A while back, but still weird...
6th April 2012, 03:25 PM |#11  
Senior Member
Thanks Meter: 45
 
More
Quote:
Originally Posted by beltsnspoons

weird, i had the EXACT same issue with my last debian install. A while back, but still weird...

I have no clue what it was. I tried everything. Looked up solutions ant there were none. I reinstalled 3 times and it still did it

Sent from my SPH-D700 using XDA
Post Reply Subscribe to Thread

Tags
boot, kernel, linux, rom, ubuntu

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

Advanced Search
Display Modes