[ROM] Native Ubuntu on the Epic!

Search This thread

DrGit

Senior Member
Jan 19, 2010
151
210
sudo cp /usr/bin/qemu-arm-static /media/linux/usr/bin
Do "sudo apt-get install qemu-arm-static".

sudo tar xvf /path/to/modules.txz -C /media/linux/lib/modules
You don't need these, the WiFi driver doesn't work anyway.

Also, when making the linux partition, should it be a primary or extended partition?
I usually do primary, but I don't think it will have trouble if it's extended. Don't quote me on that, though, I haven't tried it. As long as it's the second partition (and not FAT) it should work.
 
  • Like
Reactions: sterfreak

bbelos

Inactive Recognized Developer
Apr 23, 2011
923
2,780
Chicago
A couple other steps I had to take during setup, not sure if anyone else will need this:

During step 2, I modified the apt sources.list before entering chroot, but also ran these commands to allow for apt updates to work
Code:
$ sudo mount -o bind /proc /media/linux/proc
$ sudo mount -o bind /dev /media/linux/dev
$ sudo mount -o bind /dev/pts /media/linux/dev/pts
$ sudo mount -o bind /sys /media/linux/sys
$ sudo cp /etc/resolv.conf /media/linux/etc/resolv.conf
$ sudo chroot /media/linux

Substitute for your mount point, and maybe only the resolv.conf file is needed, but either way, it worked. I'm still working on my setup, but at least I can install packages, and it boots. :)
 

sterfreak

Senior Member
Jan 26, 2011
65
4
Silverado
A couple other steps I had to take during setup, not sure if anyone else will need this:

During step 2, I modified the apt sources.list before entering chroot, but also ran these commands to allow for apt updates to work
Code:
$ sudo mount -o bind /proc /media/linux/proc
$ sudo mount -o bind /dev /media/linux/dev
$ sudo mount -o bind /dev/pts /media/linux/dev/pts
$ sudo mount -o bind /sys /media/linux/sys
$ sudo cp /etc/resolv.conf /media/linux/etc/resolv.conf
$ sudo chroot /media/linux

Substitute for your mount point, and maybe only the resolv.conf file is needed, but either way, it worked. I'm still working on my setup, but at least I can install packages, and it boots. :)

This should be added to the instructions. Hard to add packages without this step.
 

DrGit

Senior Member
Jan 19, 2010
151
210
This should be added to the instructions. Hard to add packages without this step.

You only need to mount the target filesystem with "dev" permissions (mount -o remount,dev /media/linux) to add packages.
Bind mounting shouldn't be necessary - in fact, it's a security risk, as it exposes your host devices to the chroot.

Instead of using your host system's resolv.conf, you can use Google's public DNS server, which I find faster and more convenient:
Code:
echo "nameserver 8.8.8.8" |sudo tee /media/linux/etc/resolv.conf
 
Last edited:
  • Like
Reactions: bbelos

xplus93

Senior Member
May 25, 2010
302
31
i know we aren't supposed to ask these questions, but how is it looking for modem drivers? It would be kinda fun to use something like this as a daily. We could have unlimited UI possibilities.
 

darklichny

Senior Member
Dec 27, 2011
1,313
1,555
NYC
you might also want to change the OP to reflect that the git hub command should read:

git clone git://github.com/aloznat/samsung-kernel-victory.git

not

git clone git://github.com/aloznat/samsung_kernel_victory.git
(note the dashes NOT underlines...)
 

scottgl9

Senior Member
Mar 26, 2012
56
97
kernel.zip for kexec boot

I had to pull info from multiple sources as information on this project is scarce, but I put together a kernel to boot ubuntu from CWM. So here you go the file is epic4g-kexec-ubuntu-kernel.zip, and to boot from CWM5 you just do an update, and select this zip file.

http://www.2shared.com/file/vsGHqp7Z/epic4g-kexec-ubuntu-kernel.html

I think this project (more of a vague tutorial) has alot of potential, most things work pretty well it just took alot of time to get configuration and packages correct. I'll probably put out my ubuntu build for the epic 4g if anyone is interested. I'm currently playing around with video acceleration for the PowerVR SGX 540 working with xorg, and also trying to get wimax.
 
Last edited:

thomasskull666

Senior Member
Sep 24, 2010
1,553
412
St. Louis
I had to pull info from multiple sources as information on this project is scarce, but I put together a kernel to boot ubuntu from CWM. So here you go the file is epic4g-kexec-ubuntu-kernel.zip, and to boot from CWM5 you just do an update, and select this zip file.

http://www.2shared.com/file/vsGHqp7Z/epic4g-kexec-ubuntu-kernel.html

I think this project (more of a vague tutorial) has alot of potential, most things work pretty well it just took alot of time to get configuration and packages correct. I'll probably put out my ubuntu build for the epic 4g if anyone is interested. I'm currently playing around with video acceleration for the PowerVR SGX 540 working with xorg, and also trying to get wimax.

I for one would love to see what you've come up with!

Let me know if you need a place to host files :)

Sent from my SPH-D700 using xda premium
 

scottgl9

Senior Member
Mar 26, 2012
56
97
I for one would love to see what you've come up with!

Let me know if you need a place to host files :)

Sent from my SPH-D700 using xda premium

That would be great actually, I need a place to host. By the way I found a huge oversight in the kernel which most definitely prevents wifi from working. Fixing that now.

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
- a bunch of missing drivers for the epic 4g which could fix things which currently do not work such as audio and hardware acceleration
- orientation of X is portrait when it should be landscape
- quite a few audio drivers are being compiled in which I'm sure is messing up the audio support
- keyboard function keys aren't working, but I think theres a fix for this (custom keymap needed)
- usb networking support wasn't built in which is useful when wifi isn't working
 
Last edited:

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