Showing posts with label asus. Show all posts
Showing posts with label asus. Show all posts

Tuesday, October 23, 2012

Debian Kit Part 2: External MicroSD config on Asus TF101

Some days ago I had managed to successfully and unfortunately soft-brick my Asus Eee Pad Transformer TF101 due to incorrectly using a Nvflash utility for SBKv1 devices on my SBKv2 device. Long story short: The fiasco led to the specially-made partitioning on my tablet's internal storage to be overwritten by garbage, taking the bootloader with it.

Thankfully it's not really that hard to completely flash the tablet back to normalcy thanks to Nvidia's nvflash utility and the tablet's APX mode. I managed to put the tablet back to Asus's stock ROM. Regaining root logins and privileges was trivial and now I managed to put in my previous daily driver ROM, Android Revolution HD, back into my Transformer.

To make my tablet two times as useful as it was at that moment, I've decided to reinstall Debian Kit. It is unfortunate that I had forgotten to back up the loopback image stored in my tablet's internal SD storage, so I had to reconfigure everything from scratch again. With that, however, I had the opportunity to do something different: I planned to put Debian on my tablet's external SD card, which is inserted on the right side of the tablet itself, not the one on the keyboard dock.

It is important to note, however, that most external SD cards are significantly slower than internal SD storages put inside most phones and tablets. The external SD card I used is a cheap class-2 16GB that I bought from CD-R king (of all places), so needless to say, my Debian install is going to be slow as fuck. Installing a package from the repositories for example, takes quite a long time, with most of the time wasted on unpacking, setting up, and installing the packages.

I partitioned the external microSD using gParted on my Thinkpad, with 12GB partitioned as ext3 (this is what Debian will use) and the rest of the remaining space as a FAT32 partition, because I don't think I'll be needing an entire ~16GB worth of space for an OS residing within another OS, especially when most of my work is done on the command line. It's formatted as FAT32 because apparently that and NTFS are the most convenient file systems that Android natively automatically mounts on its own. Following the instructions of a Debian Kit installation, instead of the usual opt to install the loopback image on a rather small 2GB file in the internal storage, I did the following with mk-debian:

# mk-debian -i /dev/block/mmcblk1p1 -d precise -t ext3

Where /dev/block/mmcblk1p1 corresponds to the 12GB ext3 partition that I had created earlier on my external microSD. Note that I did not use /dev/block/mmcblk1 because that corresponds to the entire block device, rather than one of its partitions.

So Debian Kit did its thing and installed a minimal install of Debian that for some reason follows the apt repositories of Ubuntu 12.04 Precise, so I can't really tell if it's Debian or Ubuntu, though I'll just settle on calling it Debian for now. Anyway, I digress. After Debian had finished its usual setting-up, I began to set up my installation according to my specifications. I followed most of the stuff on the Debian Kit manual regarding andromize, created a normal user for myself, adding sudo privileges for the said user, fixed the timezone being set in UTC by default, and reimporting my dot-config files from my Thinkpad. So far, so good.

Once I let the tablet go to sleep, however, either when it automatically does after a time period of inactivity or when I close the lid with the dock connected, the block partition "disappears". That is to say, when I get back to my Debian install through the terminal, and do a command such as ls, the command is strangely not found by the system. The same thing happened to cd. I then concluded that I the block disappeared and now I'm just running off the system from memory.

I figured that it was something wrong with my ROM of some sort. I noticed that whenever external volumes (SDcards, USB drives) are inactive and the tablet goes into sleep, Android automatically unmounts them, then remounts them back again when I wake the device. I did a little research on this annoying behaviour and found out that it's a "feature" made by Asus. I then hypothesized that Asus was extremely bright to unmount the entire device rather than just the partitions that it can read (which is to say, when the ROM decides to unmount the FAT32 partition /dev/block/mmcblk1p2, it takes the ext3 partition /dev/block/mmcblk1p1 along with it as well). Since Android Revolution HD branched itself out from the stock ROMs of Asus, the behavior persisted on my custom ROM.

I figured that the ROM only does this on filesystems that it naturally (in a sense that I can see and use them on the native Android interface) detects and supports, like FAT32. So I repartitioned my external SD card again, only this time I made the ext3 partition take up the entire storage space on the device. After that I made Debian Kit install itself on the newer, larger partition.

That is currently my setup as of now and thankfully /dev/block/mmcblk1 stops disappearing whenever my TF101 goes into sleep mode. However, I noticed that after a long uptime /dev/block/mmcblk1 eventually disappears again. I do not know at the moment if it happens during activity or inactivity, but very recently I left my Debian user account logged in overnight and when I tried to use it again the following morning it appears that my partition had disappeared once again. It's solvable with a reboot, but rebooting is tedious and takes some time.

I will look further into this problem and check for any solutions. Hopefully it's something related to my ROM and not any of my hardware. If that's the case, I'll just take a look at some sweet Android 4.1.2 Jellybean ROMs, and try them on my tablet.

Sunday, September 9, 2012

Debian Kit: Debian Squeeze/Ubuntu[Lucid/Precise] on your Android device

Because my very trusted and loyal IBM/Lenovo Thinkpad X60s has been "deskridden" for quite a while now, so to speak, I now turn to my Asus Eee Pad Transformer TF101 as my new mobile computer. Here are its basics:
  • It runs Android 3.0 Honeycomb when I bought it, but currently it's running on the custom Android Revolution 4.0.3 ICS ROM, though "custom" doesn't seem like the right word here as they [Android Revolution] tries to keep themselves looking stock-like.
  • It has a dual-core Nvidia Tegra 2 CPU, clocked at 1GHz a core.
  • It has this shiny dock with a shitty keyboard, but still, it sure beats having to use a software on-screen keyboard.
  • Did I mention the keyboard also serves as a second battery?
If you want more info on my Transformer, you're better off Googling it yourself and reading about them elsewhere.

The Transformer has been immensely useful for regular productivity tasks. The default browser, strangely named "Browser", and which I assume is based on the FOSS Chromium browser code, works well enough, though I keep Google's own Google Chrome browser with me as well (it's shinier, damn it). Both of them are great enough for casual browsing. For documents, I can easily access my stuff from Dropbox, though actually getting stuff into Dropbox is quite uncertain (though there are some workarounds for this). Polaris Office seems to be sufficient enough for basic document editing, though I'd like to liken it to a word processor built for a Vtech kid's "laptop". So most of the time I'm editing my documents through Google Docs, or not at all, since I hate word processors.

But I'm a student of Computer Science, a Software Engineer, and a hacker at heart, so this wasn't quite enough for me. In essence, the original "productivity suite" my Transformer offered to me at the start appears to be more appealing for children ("regular" Android tablet users might say the same thing to people with iPads, but I digress). So I started searching for solutions to my little problem.

My first attempt to fix the problem are, as ashamed as I am to admit it, using ready-to-use apps from Google Play. I got some text editors here and there, though they all sucked and couldn't hold a candle to Vim. I also grabbed a couple of C and C++ compilers, because sometimes I some code prototyping and I occasionally teach and help a certain list of people how to code. I also installed "Scripting Language for Android", or SL4A for short. SL4A, as far as I can understand, is a collection of interpreters and such for different scripting languages, most notably, Python and Perl; that you can run on your Android device, though it seems that native Android app development using scripting languages is still pretty much uncertain (sorry folks, you'll still have to live with Java).

But I wasn't satisfied with those yet. I preferred working in a command-line interface, so I needed a good terminal emulator. Unfortunately the one that you can easily get from Google Play will most definitely suck if you do not have root permissions on your device (this was before I decided to root the Transformer). Fortunately, there's Terminal IDE, a suite of command line software development tools that run on its own userspace. However, being jailed in its own userspace has some distinct disadvantages, one of these is that fact that everything in Terminal IDE is being jailed in its own userspace.

I tried SSH'ing remotely into my Thinkpad as well, though this effectively turns my Transformer into a dumb terminal, plus the Internet connections of the Philippines are too shitty to effectively maintain a stable remote connection.

Debian Kit


After a lot of lurking around on the web, however, I've discovered Debian Kit for Android. This little solution puts a complete GNU/Linux Debian installation inside your Android device, allowing it to work side by side with the Android OS, rather than, say, completely replacing or dual-booting alongside it.

The idea of a GNU/Linux distribution running inside Android isn't particularly new, however. Numerous people have gone lengths to do the same, though their solutions usually boils down to chroot'ing the distro inside Android. This means the distro will run in its own little "virtual environment" inside Android. The big disadvantage in this approach is that the distro's world is limited to that little environment, which means you'll have difficultly accessing the files on your Android device's SD card, etc.

Debian Kit does this differently. According to its creator, Debian Kit effectively makes Debian/Ubuntu run side-by-side with Android through cleverly-made symlinking and bind-mounting. It will allow you to access the different storage devices present on your Android device, which is extremely important, at least for me.

I won't be writing instructions on how to set up Debian Kit on your Android device here. If I did it would be completely redundant and unnecessary. The creator of Debian Kit has written adequate documentation regarding the installation and my install worked after I did one or two read throughs. Also, he made some screencasts for the people who does not RTFM.

Though, there is one important thing that he forgot to document, and that is manually adjusting Debian/Ubuntu's timezone. On a regular installation procedure of Debian, the installer automatically sets this up for you, but in Debian Kit this isn't present, so your timezone is automatically set at UTC +0. This is fine for you people living somewhere in the UK, but not for everybody else who aren't. This has been a pain in the ass for me for a long time until I finally found a solution through a bit of Googling.

The solution for the borked timezone is the here (courtesy of Geek Ride).

Right now I'm reinstalling Debian Kit on the Transformer because I thought by doing so, I could fix the timezone, but no it didn't, so now I'm about to configure everything again. Thankfully the only thing that's a nuisance to replace is my SSH key, but that should be easy to regenerate and remanage.