Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

[HOWTO] Ubuntu Dual-boot MicroSD card!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [HOWTO] Ubuntu Dual-boot MicroSD card!

    Getting Ubuntu running on my PMID701i was a piece of cake!
    The 12.10 pre-releases are really smooth on this tablet, and I'm very pleased with the performance.

    Working hardware/drivers:
    * Unaccelerated framebuffer/X11, using fbdev until I can figure out the Mali driver.
    * Touchscreen, with 5-point multitouch (tested with QT demos.) I had to make a small modification to the ft5x_ts driver, otherwise it doesn't register a click when you touch the screen.
    * CPU frequency scaling! I've heard people saying the A10 reboots when clocked over 1152MHz, but with proper cooling and/or voltage settings, we may be able to overclock further. I don't want to try though, because my tablet gets hot even at 1GHz. Underclocking works (60MHz-1GHz supported, 1-1.5GHz possible but not recommended), but I'm unsure about undervolting.
    * WiFi works using the kernel rtl8150 driver (8192cu.ko).
    * Audio works, however by default (ondemand cpufreq governor runs @60MHz) it is slow and extremely choppy. Workaround: different CPU frequency or governor (sudo apt-get install cpufrequtils indicator-cpufreq).

    Needs work:
    * Battery indicator is messed up - it says "no battery present" until you plug in a charger, but after that it reports the percentage.
    * Mali GPU. See http://rhombus-tech.net/allwinner_a1...river_for_A10/
    * CedarX video accelerator, needs closed-source drivers. This might be required to use the video-out jack.
    * USB Host should work fine, but I haven't ordered an OTG cable yet. A USB gender changer will NOT work!

    Let the tutorial commence!

    Requirements:
    * 2GB microSD card. 4GB or more highly recommended!
    * Computer running Linux. Ubuntu 12.04 LiveCD recommended for Windows users.
    * Git and ARM toolchain installed: sudo apt-get install build-essential gcc make git-core gcc-arm-linux-gnueabi
    * Optional: Android Debug Bridge from the Android SDK for copying files to/from your tablet.
    * Basic command line knowledge, spare time, and patience!

    Step 1: Format/partition your microSD card from your computer

    Please make sure the card is empty or you have backups of its contents before doing this.
    In theory, you can keep its contents intact since all you're doing is resizing the FAT partition to make room for a Linux partition and installing a bootloader. Just remember that I won't assume responsibility if you lose any important data following these steps.


    The following steps use GNU parted, which is a command-line program. You can try GParted (sudo apt-get install gparted) for an easier GUI tool, but the steps are basically the same.
    Code:
    sudo apt-get install parted
    sudo fdisk -l # Identify your SD card's block device name. (e.g. /dev/sdc or /dev/mmcblk0 for built-in card readers.)
    sudo parted /dev/mmcblk0 # Substitute the correct name if necessary.
    From inside parted, determine how much space you need on the FAT partition.
    You'll need to leave 2MB free at the beginning for the bootloader and at least 2GB for a new Linux partition. On a small (<4GB) card, 32MB will suffice as a minimum size for the FAT partition. If you want to continue storing data on the FAT partition, resize accordingly.

    Code:
    # Type this inside parted:
    resize 1 2M 2000M
    # (Change 2000M to the size you determined for your FAT partition.)
    # Then make a new Linux partition:
    mkpart primary ext4
    # Pay attention, it might ask you for start/end sizes.
    # When you're done, type:
    quit
    Step 2: Build/obtain the kernel, script.bin, and bootloader
    I might post pre-built binaries soon, but in the meantime, it doesn't hurt to try building them yourself.

    For the bootloader, we will be using U-boot (github.com/hno/uboot-allwinner).
    Check out https://github.com/hno/uboot-allwinner/wiki if you get confused.
    Code:
    git clone https://github.com/hno/uboot-allwinner.git
    mkdir ~/Polaroid && cd ~/Polaroid
    cd uboot-allwinner
    make sun4i CROSS_COMPILE=arm-linux-gnueabi-
    # Now install it on your SD card. Substitute your actual block device. It doesn't matter whether it's mounted or not since the bootloader lives in the 2MB of unpartitioned space before your FAT partition. Still, be careful with these commands!
    sudo dd if=spl/sun4i-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
    sudo dd if=u-boot.bin of=/dev/mmcblk0 bs=1024 seek=32
    For the kernel, we'll be using github.com/amery/linux-allwinner.
    Code:
    cd ~/Polaroid
    mkdir modules
    git clone https://github.com/amery/linux-allwinner.git
    cd linux-allwinner
    make ARCH=arm sun4i_crane_defconfig
    make ARCH=arm menuconfig
    # The default config should work fine, but I'll upload my custom config later if anyone's interested.
    nano drivers/input/touchscreen/ft5x_ts.c
    # In ft5x_ts_release(), around line 1223, change the #else to an #endif and delete the #endif after "input_report_key(data->input_dev, BTN_TOUCH, 0);" so it reports BTN_TOUCH in multitouch mode.
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage -j4
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4
    make ARCH=arm modules_install INSTALL_MOD_PATH=../modules
    # Mount the FAT partition on your SD card. I usually label the partition "SD" so it mounts at /media/SD, but your mountpoint will probably differ.
    cp arch/arm/boot/uImage /media/SD
    adb shell mkdir /mnt/nanda
    adb shell mount /dev/nanda /mnt/nanda
    adb pull /mnt/nanda/script.bin /media/SD/
    adb shell umount /mnt/nanda
    adb shell rmdir /mnt/nanda
    Step 3: Obtain/build the root filesystem!
    Ubuntu, Debian, MeeGo/Nemo, Tizen, Fedora, Arch, Gentoo, and Slackware Linux all have ARM ports, so unless you like Ubuntu as much as I do, you're welcome to try something else!

    You have several options here. I recommend downloading an Ubuntu-core daily build (http://cdimage.ubuntu.com/ubuntu-cor...e-armhf.tar.gz), but you can try an OMAP3/4 Ubuntu Desktop image if you have enough space and loop-mounting patience, which I don't :P
    Just extract it to your Linux partition like so:
    Code:
    sudo tar xvf ~/Downloads/quantal-core-armhf.tar.gz -C /media/Ubuntu
    # This assumes your new Linux partition is mounted at /media/Ubuntu. It won't be mounted there unless you label the partition in [G]parted. Open Nautilus or your file manager and locate its mount point.
    Now install your kernel modules and prepare the filesystem for usage:
    Code:
    sudo cp -a ~/Polaroid/modules/* /media/Ubuntu
    sudo apt-get install qemu-user-static
    sudo cp /usr/bin/qemu-arm-static /media/Ubuntu/usr/bin/
    sudo chroot /media/Ubuntu
    # Now you're in an emulated ARM chroot!
    apt-get update
    # You may have to edit /etc/apt/sources.list to add the universe repository.
    apt-get dist-upgrade
    apt-get install lightdm gnome-session-fallback onboard
    # OR...
    apt-get install plasma-active
    # OR...
    apt-get install lightdm e17 lxde xfce4
    apt-get install ubuntu-desktop # Be prepared for no free space and lots of stuff you don't need!
    # etc. Now configure a non-root user:
    adduser ubuntu
    addgroup --system admin
    usermod -a -G admin ubuntu
    mkdir /media/SD # Permanent mount point for your FAT partition
    echo "/dev/mmcblk0p2 / auto defaults 0 1">>/etc/fstab
    echo "/dev/mmcblk0p1 /media/SD auto defaults 0 0">>/etc/fstab
    exit
    Step 4: Unmount and remove your SD card from your computer, insert it in your tablet, and power it on!
    Make sure you install onboard or use a USB keyboard, otherwise you won't be able to log in.
    Have fun!

    #2
    Originally posted by aloznat View Post
    Getting Ubuntu running on my PMID701i was a piece of cake!
    The 12.10 pre-releases are really smooth on this tablet, and I'm very pleased with the performance.

    Working hardware/drivers:
    * Unaccelerated framebuffer/X11, using fbdev until I can figure out the Mali driver.
    * Touchscreen, with 5-point multitouch (tested with QT demos.) I had to make a small modification to the ft5x_ts driver, otherwise it doesn't register a click when you touch the screen.
    * CPU frequency scaling! I've heard people saying the A10 reboots when clocked over 1152MHz, but with proper cooling and/or voltage settings, we may be able to overclock further. I don't want to try though, because my tablet gets hot even at 1GHz. Underclocking works (60MHz-1GHz supported, 1-1.5GHz possible but not recommended), but I'm unsure about undervolting.
    * WiFi works using the kernel rtl8150 driver (8192cu.ko).
    * Audio works, however by default (ondemand cpufreq governor runs @60MHz) it is slow and extremely choppy. Workaround: different CPU frequency or governor (sudo apt-get install cpufrequtils indicator-cpufreq).

    Needs work:
    * Battery indicator is messed up - it says "no battery present" until you plug in a charger, but after that it reports the percentage.
    * Mali GPU. See http://rhombus-tech.net/allwinner_a1...river_for_A10/
    * CedarX video accelerator, needs closed-source drivers. This might be required to use the video-out jack.
    * USB Host should work fine, but I haven't ordered an OTG cable yet. A USB gender changer will NOT work!

    Let the tutorial commence!

    Requirements:
    * 2GB microSD card. 4GB or more highly recommended!
    * Computer running Linux. Ubuntu 12.04 LiveCD recommended for Windows users.
    * Git and ARM toolchain installed: sudo apt-get install build-essential gcc make git-core gcc-arm-linux-gnueabi
    * Optional: Android Debug Bridge from the Android SDK for copying files to/from your tablet.
    * Basic command line knowledge, spare time, and patience!

    Step 1: Format/partition your microSD card from your computer

    Please make sure the card is empty or you have backups of its contents before doing this.
    In theory, you can keep its contents intact since all you're doing is resizing the FAT partition to make room for a Linux partition and installing a bootloader. Just remember that I won't assume responsibility if you lose any important data following these steps.


    The following steps use GNU parted, which is a command-line program. You can try GParted (sudo apt-get install gparted) for an easier GUI tool, but the steps are basically the same.
    Code:
    sudo apt-get install parted
    sudo fdisk -l # Identify your SD card's block device name. (e.g. /dev/sdc or /dev/mmcblk0 for built-in card readers.)
    sudo parted /dev/mmcblk0 # Substitute the correct name if necessary.
    From inside parted, determine how much space you need on the FAT partition.
    You'll need to leave 2MB free at the beginning for the bootloader and at least 2GB for a new Linux partition. On a small (<4GB) card, 32MB will suffice as a minimum size for the FAT partition. If you want to continue storing data on the FAT partition, resize accordingly.

    Code:
    # Type this inside parted:
    resize 1 2M 2000M
    # (Change 2000M to the size you determined for your FAT partition.)
    # Then make a new Linux partition:
    mkpart primary ext4
    # Pay attention, it might ask you for start/end sizes.
    # When you're done, type:
    quit
    Step 2: Build/obtain the kernel, script.bin, and bootloader
    I might post pre-built binaries soon, but in the meantime, it doesn't hurt to try building them yourself.

    For the bootloader, we will be using U-boot (github.com/hno/uboot-allwinner).
    Check out https://github.com/hno/uboot-allwinner/wiki if you get confused.
    Code:
    git clone https://github.com/hno/uboot-allwinner.git
    mkdir ~/Polaroid && cd ~/Polaroid
    cd uboot-allwinner
    make sun4i CROSS_COMPILE=arm-linux-gnueabi-
    # Now install it on your SD card. Substitute your actual block device. It doesn't matter whether it's mounted or not since the bootloader lives in the 2MB of unpartitioned space before your FAT partition. Still, be careful with these commands!
    sudo dd if=spl/sun4i-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
    sudo dd if=u-boot.bin of=/dev/mmcblk0 bs=1024 seek=32
    For the kernel, we'll be using github.com/amery/linux-allwinner.
    Code:
    cd ~/Polaroid
    mkdir modules
    git clone https://github.com/amery/linux-allwinner.git
    cd linux-allwinner
    make ARCH=arm sun4i_crane_defconfig
    make ARCH=arm menuconfig
    # The default config should work fine, but I'll upload my custom config later if anyone's interested.
    nano drivers/input/touchscreen/ft5x_ts.c
    # In ft5x_ts_release(), around line 1223, change the #else to an #endif and delete the #endif after "input_report_key(data->input_dev, BTN_TOUCH, 0);" so it reports BTN_TOUCH in multitouch mode.
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage -j4
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4
    make ARCH=arm modules_install INSTALL_MOD_PATH=../modules
    # Mount the FAT partition on your SD card. I usually label the partition "SD" so it mounts at /media/SD, but your mountpoint will probably differ.
    cp arch/arm/boot/uImage /media/SD
    adb shell mkdir /mnt/nanda
    adb shell mount /dev/nanda /mnt/nanda
    adb pull /mnt/nanda/script.bin /media/SD/
    adb shell umount /mnt/nanda
    adb shell rmdir /mnt/nanda
    Step 3: Obtain/build the root filesystem!
    Ubuntu, Debian, MeeGo/Nemo, Tizen, Fedora, Arch, Gentoo, and Slackware Linux all have ARM ports, so unless you like Ubuntu as much as I do, you're welcome to try something else!

    You have several options here. I recommend downloading an Ubuntu-core daily build (http://cdimage.ubuntu.com/ubuntu-cor...e-armhf.tar.gz), but you can try an OMAP3/4 Ubuntu Desktop image if you have enough space and loop-mounting patience, which I don't :P
    Just extract it to your Linux partition like so:
    Code:
    sudo tar xvf ~/Downloads/quantal-core-armhf.tar.gz -C /media/Ubuntu
    # This assumes your new Linux partition is mounted at /media/Ubuntu. It won't be mounted there unless you label the partition in [G]parted. Open Nautilus or your file manager and locate its mount point.
    Now install your kernel modules and prepare the filesystem for usage:
    Code:
    sudo cp -a ~/Polaroid/modules/* /media/Ubuntu
    sudo apt-get install qemu-user-static
    sudo cp /usr/bin/qemu-arm-static /media/Ubuntu/usr/bin/
    sudo chroot /media/Ubuntu
    # Now you're in an emulated ARM chroot!
    apt-get update
    # You may have to edit /etc/apt/sources.list to add the universe repository.
    apt-get dist-upgrade
    apt-get install lightdm gnome-session-fallback onboard
    # OR...
    apt-get install plasma-active
    # OR...
    apt-get install lightdm e17 lxde xfce4
    apt-get install ubuntu-desktop # Be prepared for no free space and lots of stuff you don't need!
    # etc. Now configure a non-root user:
    adduser ubuntu
    addgroup --system admin
    usermod -a -G admin ubuntu
    mkdir /media/SD # Permanent mount point for your FAT partition
    echo "/dev/mmcblk0p2 / auto defaults 0 1">>/etc/fstab
    echo "/dev/mmcblk0p1 /media/SD auto defaults 0 0">>/etc/fstab
    exit
    Step 4: Unmount and remove your SD card from your computer, insert it in your tablet, and power it on!
    Make sure you install onboard or use a USB keyboard, otherwise you won't be able to log in.
    Have fun!
    Hello!


    My .02 worth...

    Yeah, you have to ground one of the contacts on the USB cable to support OTG; I forget which one. There are tutorials online that tell you how to mod a standard USB cable for OTG. However, you still need a gender changer.

    A Lubuntu ARM port would be nice. Perhaps I can use LXDE instead of Unity. Also, tell me more about how to install onboard, as I have not yet attempted to make my own OTG cable to run a USB KB. When I do, I'll post how I did it...

    73 DE N4RPS
    Rob

    Comment


      #3
      Originally posted by N4RPS View Post
      Hello!


      My .02 worth...

      Yeah, you have to ground one of the contacts on the USB cable to support OTG; I forget which one. There are tutorials online that tell you how to mod a standard USB cable for OTG. However, you still need a gender changer.

      A Lubuntu ARM port would be nice. Perhaps I can use LXDE instead of Unity. Also, tell me more about how to install onboard, as I have not yet attempted to make my own OTG cable to run a USB KB. When I do, I'll post how I did it...

      73 DE N4RPS
      Rob

      If you are using Ubuntu 7.10 or greater, onboard should be installed by default, but you can also download it in the Synaptic Package Manager.
      You can start onboard by opening up a terminal and typing:
      onboard
      If onboard is not installed, you can install it, as mentioned above, using the Synaptic Package Manger or from the terminal. To install it from the terminal, type:
      sudo apt-get install onboard


      and yes it can be used to login with

      Comment


        #4
        I am going to try this. Everything seems relatively straight forward except for one thing. How does the tablet know to boot from the SD card instead of from the internal memory as per normal?
        Polaroid PMID701i 13
        Stock Rom from S.T.'s site
        Fully rooted
        Google's Market installed

        Comment


          #5
          Originally posted by lukenova View Post
          I am going to try this. Everything seems relatively straight forward except for one thing. How does the tablet know to boot from the SD card instead of from the internal memory as per normal?
          In case you didn't figure it out, installing the SPL and u-boot image to the SD card and powering the tablet on with the card inserted will automatically load what's on the card, thanks to the awesome A10 chip.

          I recently tried some creative Linux apps (the GIMP, VMPK multitouch virtual MIDI keyboard, and Maemo Theremin) and noticed that even though the audio latency isn't bad, the input latency is so bad it ruins the fun of those apps. For example, swiping my fingers accross the screen fast in the QT finger paint demo (apt://qt4-demos, /usr/lib/qt4/examples/touch/fingerpaint/fingerpaint) results in not a line/stroke, but separated circles along that path, with a latency of between 100 and 200ms. I read somewhere that it's because the ft5206 touch IC/panel used in this tablet was designed for 2-4" screens!

          I'm quite disappointed with the touchscreen, and there doesn't seem to be much I can do about it in software. All the tweaks I've seen are for other touchscreen hardware/drivers, and the closest ones to my hardware are for the ft5406 used in the Kindle Fire and Nook Tablet, which have better sensitivity because the capacitive sensing lines aren't so far apart.

          This is where I wish the Nexus 7 was cheaper and had expandable storage. And/or I wish I had more money. Oh well :P

          Comment


            #6
            PMID701c

            Will this work for a 701c or does it have to have an A10?

            Comment


              #7
              Originally posted by Android_n00b View Post
              Will this work for a 701c or does it have to have an A10?
              A PMID701C *is* an A10
              https://public.bay.livefilestore.com...ion.png?psid=1

              Comment


                #8
                Oh

                Originally posted by elektrik View Post
                A PMID701C *is* an A10
                OH Oops Tehe

                Comment


                  #9
                  Page not found

                  I get a 404 error Page Not Found, when I click the link to the U-boot. I searched around a little on github and found berryboot, will that work? It has subsection on A10 Alwinners.

                  Berryboot -- Boot menu / OS installer. Contribute to maxnet/berryboot development by creating an account on GitHub.

                  Comment


                    #10
                    Originally posted by Android_n00b View Post
                    I get a 404 error Page Not Found, when I click the link to the U-boot. I searched around a little on github and found berryboot, will that work? It has subsection on A10 Alwinners.
                    Go to http://linux-sunxi.org/ It has everything you'll need and then some...

                    Comment


                      #11
                      Thanks

                      Originally posted by dolorespark View Post
                      Go to http://linux-sunxi.org/ It has everything you'll need and then some...
                      OK Thanks.

                      Comment

                      Working...
                      X