[ROM] Native Ubuntu on the Epic!

Search This thread

DrGit

Senior Member
Jan 19, 2010
151
210
Not sure if you saw this but it looks like their is work on an open source driver. This is for the graphics hardware

https://github.com/tom3q/openfimg/wiki

Sent from my SPH-D700 using Tapatalk 2

Sadly, the Epic uses the S5PC110 core with PowerVR SGX graphics, so this driver won't work.

Things I've found wrong:
- wifi is being compiled as a module, so I changed to built-in at least for now
- wifi firmware path expect /system root, which it shouldn't
The firmware can't be included in the kernel due to the proprietary license, that's why it has to be a module.
Try copying (adb pull) /system/vendor/firmware/fw_bcm4329.bin and /system/etc/wifi/nvram_net.txt to /lib/firmware on your rootfs, then add this to /etc/modules:
Code:
bcm4329 iface_name=wlan0 firmware_path=/lib/firmware/fw_bcm4329.bin nvram_path=/lib/firmware/nvram_net.txt
- orientation of X is portrait when it should be landscape
See the commented-out lines in X11.txt in the OP.
- quite a few audio drivers are being compiled in which I'm sure is messing up the audio support
It has nothing to do with the audio drivers being built-in - PulseAudio doesn't set up the mixer paths properly, which is the driver/ALSA's fault. Right now, you have to manually set the playback path with alsamixer. I still don't get sound in any apps. For example, Audacious says "lsync failed," and other apps appear to start playing sound but they get underruns. Well, more like 100% underrun and 0% sound :/
- keyboard function keys aren't working, but I think theres a fix for this (custom keymap needed)
I started writing a kernel keymap ("loadkeys" format), but I don't think X uses those settings. Writing XKB layouts is painful, so I just went with an incomplete kernel keymap, hence no symbol keys.
- usb networking support wasn't built in which is useful when wifi isn't working
USB networking wasn't built in because the machine code complains if you try to replace the non-standard Android USB function driver with Linux USB "gadget". Adding USB networking to the Android function driver may work, but it's more complicated to set up outside of Android.
 
Last edited:

scottgl9

Senior Member
Mar 26, 2012
56
97
Thanks for the feedback gTan64, it was quite helpful. I will soon be putting out an ubuntu build.

Sadly, the Epic uses the S5PC110 core with PowerVR SGX graphics, so this driver won't work.


The firmware can't be included in the kernel due to the proprietary license, that's why it has to be a module.
Try copying (adb pull) /system/vendor/firmware/fw_bcm4329.bin and /system/etc/wifi/nvram_net.txt to /lib/firmware on your rootfs, then add this to /etc/modules:
Code:
bcm4329 iface_name=wlan0 firmware_path=/lib/firmware/fw_bcm4329.bin nvram_path=/lib/firmware/nvram_net.txt

See the commented-out lines in X11.txt in the OP.

It has nothing to do with the audio drivers being built-in - PulseAudio doesn't set up the mixer paths properly, which is the driver/ALSA's fault. Right now, you have to manually set the playback path with alsamixer. I still don't get sound in any apps. For example, Audacious says "lsync failed," and other apps appear to start playing sound but they get underruns. Well, more like 100% underrun and 0% sound :/

I started writing a kernel keymap ("loadkeys" format), but I don't think X uses those settings. Writing XKB layouts is painful, so I just went with an incomplete kernel keymap, hence no symbol keys.

USB networking wasn't built in because the machine code complains if you try to replace the non-standard Android USB function driver with Linux USB "gadget". Adding USB networking to the Android function driver may work, but it's more complicated to set up outside of Android.
 

DrGit

Senior Member
Jan 19, 2010
151
210
Got Ubuntu 13.04 running and finally sorted out the touchscreen rotation via the X Input Coordinate Transformation Matrix.
I'm still working on sound and getting the cameras to work, and I'm working with a new kernel base since my Github got too messy and outdated.

This could be more fun than Ubuntu Touch since actual existing apps will run on it!
Sorry for bumping my oooold post - I wish I had more exciting news for you, but at least I'm still working on it.
 

emceeskwaird

Member
Aug 24, 2009
46
3
Would love to see a update to this with a step by step how to ...been following this and the other thread since there creation and have been under the impression that development was dead in the water with native ubuntu runnning on our epic 4g.
Keep up the good work :)
Sent from my SPH-D700 using xda premium
 

DrGit

Senior Member
Jan 19, 2010
151
210
Would love to see a update to this with a step by step how to ...been following this and the other thread since there creation and have been under the impression that development was dead in the water with native ubuntu runnning on our epic 4g.
Keep up the good work :)
Sent from my SPH-D700 using xda premium

The step-by-step tutorial I wrote wasn't easy enough for you? I'll keep trying to simplifying it, and maybe I'll put up a pre-built filesystem too.
Anyway, I got sound to work! I'm cleaning up my patches and preparing the pre-built kernel, which should be up shortly.
 
  • Like
Reactions: lavaclaw

jeffreyjicha

Senior Member
Jun 21, 2010
480
124
Reno
Where do I get the Ubuntu zip file? Am I required to build it?

Sent from my SPH-D700 using xda app-developers app

I'm telling you kindly to read the OP. The steps to install Ubuntu on your Epic are there, which includes downloading and extracting the files needed. And your PC has to have a Linux distro in order to do this anyway.

Sent from my SPH-D700 using Tapatalk 2
 

iatedeadpeople

Senior Member
Mar 4, 2011
150
19
Oakley
I'm telling you kindly to read the OP. The steps to install Ubuntu on your Epic are there, which includes downloading and extracting the files needed. And your PC has to have a Linux distro in order to do this anyway.

Sent from my SPH-D700 using Tapatalk 2

I have, what confuses me is the fact it says "get the files you need", from where?

And im aware I need linux.

Sent from my SPH-L900 using xda app-developers app
 

burthold

New member
Apr 7, 2008
1
0
if you want to use 13.04 the image is here cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    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!
    7
    Where did this GNOME 3 vs. Unity vs. MATE vs. me discussion come from?
    I hate to be the forum police, but please stay on topic.

    It appears I'm still the only person actually running this, so until things get easier - preconfigured SD image, better kernel, guide, screenshots, etc - I'd much prefer feedback to speculation. I'm working with bbelos to fix the kernel 3.x audio, WiFi, and sleep issues, so stay tuned.
    4
    Uploaded my patches and a pre-built kernel. Test away!
    4
    Got Ubuntu 13.04 running and finally sorted out the touchscreen rotation via the X Input Coordinate Transformation Matrix.
    I'm still working on sound and getting the cameras to work, and I'm working with a new kernel base since my Github got too messy and outdated.

    This could be more fun than Ubuntu Touch since actual existing apps will run on it!
    Sorry for bumping my oooold post - I wish I had more exciting news for you, but at least I'm still working on it.
    2
    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