«

»

Feb
26

openSUSE on Android (chroot only)

"We can do it!" by workerYou all probably heard about Ubuntu for Android, right? Ubuntu is very good in the marketing and they can do a lot of locomotion around everything. So what if you have Android, want to use Linux distribution and Ubuntu isn’t your cup of tee? You can use openSUSE of course! Let me show you how…

Requirements

What do you need? Obviously some device with Android. And as our main focus in openSUSE is on newer devices, you’ll need armv7 one. How do you know whether your device is new enough? For start, my old Nexus One is armv7. So if you have something newer (not counting cheap no-names), you are probably good to go. If you want to know for sure, open up the terminal on your android device and run cat /proc/cpuinfo. If it shows Processor : ARMv7, you are good to go!
Now a little bit of requirements on Android system itself. You’ll need root on your device and you’ll need decent enough busybox. Both of that is usually part of unofficial ROMs. There might be some differences and some troubles, but let’s deal with them when times come.

Separate partition installation

I would say that best way to install openSUSE is to repartition your SD card. If your are not wiling to do so, I’ll describe how to run it from file some other time… Or you can start from my previous post, replace the older script with the new one and adjust it ;-)
So let’s start repartitioning. I would suggest to take your card out of your device, put it into card reader and repartition it in your computer, where you can use nice tools like gparted. Create one ext4 partition that will hold your root. I would recommend to create it as your second partition. Some programs (like recovery programs) expects first partition to be FAT, so you’ll into some troubles otherwise. Create your partition as big as you want, but my recommendation would be at least 1G. Depending on what do you plan on doing, it can be more.
So I hope that you created partition successfully by yourselves, now it’s time to get openSUSE for your device. Where do you get that? On our download servers! Yes, we’ve got images and tarballs prepared for some devices. What you want to get is file starting with LimeJeOS-openSUSE-Factory-ARM-rootfs.armv7l and ending with -tbz.tar.bz2. Why not put whole link and make it easier for you? These images gets rebuild automatically, so the part that I left out changes over the time as you get newer and newer versions ;-) But don’t worry, you can use zypper to upgrade too ;-)
Lets put it on the card. Tarball you just downloaded actually contains another tarball and checksum. I know, not fun, but no big deal either. So get to the inner tarball, mount second partition of of your sdcard and unpack the inner tarball to it. Unpack it as a root! This can be important as as ordinary user you might not have the rights to create some files and some rights might get dropped in the process. This may result in not working system. So do the unpacking as a root. Just a hint how to do it in command line (might need some paths adjustements according to your system):

tar -C /mnt/sdcard-ext2 -xjf /home/user/download/Lime*.tbz

In the end, you should see some directories like bin and etc directly on this partition. If you do so, you are almost ready!
Now the hard part, take this script and adjust it! Don’t worry, I don’t want you to learn shell scripting, so adjusting will be pretty easy. There are only two or three lines for users to fiddle with. For partition setup, you need to change just one of them. The following one:

DEVICE="/dev/block/mmcblk1p2"

This line says where your openSUSE partition is. How to check whether it is set correctly? If you followed my advice, it will be last partition you’ve got on your device. So try running ls -1 /dev/block/mmcblk* | tail -n 1. If your busybox can’t handle that, use ls -1 /dev/block/mmcblk* and look for the last device in alphabetical order. Once you make sure the device is set correctly, you are ready to go and you can run the script in the terminal. It will put you inside openSUSE basic chroot. You can look around, there is not much of software in the beginning, but you can use zypper to install everything you need ;-)
I hope you’ll enjoy openSUSE on your mobile phone, if you want to just take a look at the script, feel free to do so. As always, if you have no idea what are you doing, you can damage your device and I take no responsibility for any damage. But if you run into some troubles, drop by on our IRC channel #opensuse-arm on Freenode and there are people willing to help. You can find me there as well, my nick is |miska|. Oh, and one last think, root and user password is linux ;-)

7 comments

  1. Francesco R. says:

    very nice will try it the first time I have time.
    tar -C /mnt/sdcard-ext2 -xjf /home/user/download/Lime*.tbz
    could benefit from an added -p?
    -p, –preserve-permissions
    extract all protection information
    tar -C /mnt/sdcard-ext2 -xpjf /home/user/download/Lime*.tbz

    1. Michal Hrušecký says:

      I think that it is default for root and I don’t think it will help ordinary users to create SUID binaries, but sure, it can’t hurt ;-)

  2. rich0 says:

    I think the new development with Ubuntu is that they plan to support X11. You can’t do that just by sticking a distro in a chroot.

    1. Michal Hrušecký says:

      Well, you can’t do that alongside with Android anyway. Maybe with USB graphics card or multiple outputs. Long known and used method was to use VNC. I was thinking about Spice, which might be much better answer on how to get both Android and X alongside, but still need some work as dual boot does :-(

  3. cyberorg says:

    Thanks to this post I tried openSUSE on my phone, and was able to get it working quite easily, have modified your script a bit to add some more features.

    https://lizards.opensuse.org/2013/02/20/opensuse-on-phonestablets/

  4. Uroš Stegić says:

    1. I know that you posted this a long time ago, but i was wandering if you can suggest me what image to download since the folder you gave in link above is empty.

    2. Does this affect my current ROM, do i get grub to determine which OS do i boot or this installation overwrites current OS and boots directly to openSUSE?

    3. Which environment do i get, is it GNOME or KDE or something else?

    4. Can this work on phones that has two memory cards, internal and (standard) external, since everything is kept on phone internal storage or internal sd-card while external sd-card being almost unnoticed by all apps and system it self?

    1. Michal Hrušecký says:

      1. Looks like there are no current factory builds, but there is a released version of openSUSE for ARM nowadays:

      http://download.opensuse.org/ports/armv7hl/distribution/12.3/images/

      2 & 3. No, it’s chroot only, so you need rooted phone and you will get only cmdline (no X), but you can run both at the same time (openSUSE terminal & Android)

      4. Yes, but you might need to adjust device names

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>