сряда, 29 август 2012 г.

How to root your Xoom MZ601

Today, I just decided I need to root my Xoom. So here's how it went.
1. I updated to Android ICS 4.0.4 over the air. It was a pleasant surprise having this update, since it's the first update I get ever.
2. I search the net for a guide for rooting from 4.0.4 The files can be found on this one: http://www.xoomforums.com/forum/team-eos/16342-rom-ics-team-eos-ics-2-0-0-updated-2012-4-27-a.html and the tutorial in the second post of http://www.xoomforums.com/forum/motorola-xoom-development/15179-how-rookie-rooting-flashing-unrooting-under-one-roof.html .
I had some problem downloading the files since I couldn't find the file for my MZ601 so instead I downloaded one of the nightly releases i.e. EOS-umts_everest-20120826-109.zip
which along with gapps-ics-20120429-signed.zip were copied into my sdcard.
The file recovery-Tiamat-R4c-100611-1150-cwm.img went into two folders since I didn't know which one was the correct one: /opt/android-sdk-update-manager/platform-tools/ and /opt/android-sdk-update-manager/tools/
And then I just followed the instruction (note that I unlocked the device just after the Factory Reset using the way described in http://www.mokonamodoki.com/motorola-xoom-final-rescue : download the Motorola tools and run $./fastboot oem unlock ) 
3. Rooting was much easier that I expected. Generally, I followed the instructions to the word and it worked.
$./adb reboot bootloader
$./fastboot flash recovery recovery-Tiamat-R4c-100611-1150-cwm.img

Once you have verification on your device that this has been flashed:
Vol Up + Power.
Vol Down to enter the boot menue

After entering in "Android Recovery":
Hold Vol. Up to enter into recovery.

Then do:
 wipe cache,
 wipe factory data,
Advance->wipe dalvik cache

Iinstall zip from sdcard- > Choose zip from sdcard
Select the  EOS-umtsgapps-ics-20120429-signed.zipGapps and flash it and then reboot.
And that's it!
Everything was done in about 5 minutes. The system rebooted in about 3 - kind of slow, but I suspect it's because this is the first time it starts. Now, you have a glorious, customized, rooted Android 4.0.4.
To unroot, you can use the third post in the same site.  There is an easier way to change curstom ROMs after the first root and it can be found on this site. It's done by using the goomanager.
Btw, I'm not sure if this ROM has a complete root or not, but one site suggests that you have to do (according to this site):
  • In the command window on your PC type; adb remount
  • Type; adb push su /system/bin
  • Type; adb shell
  • Type; ln -s /system/bin/su /system/xbin/su (this line starts with lower case “L”, like llama)
  • Type; chmod 4755 /system/bin/su
  • Type; exit
  • Type; adb push Superuser.apk /system/app
I have to try out my new Android first to see if those steps are needed, but it doesn't hurt having them posted here as well. 

неделя, 26 август 2012 г.

How to save data from a (soft) bricked Xoom

Well, even without trying to unlock or root my Xoom, I managed to brick it. I don't know how exactly it happened, I suspect it was the outcome of bad copying trough gMTP. Anyway, it got into this bootloader loop and it restarted over and over again. VERY ANNOYING!!! I was terrified, because I had some very important data on the tablet, since I use it for work. I asked and asked on the forums, but people obviously don't like answering such stupid questions. So, after tons of searching, here's what I did.

1. Install android-sdk-update-manager . If you happen to be on x64 system, install it twice - it should pull some Java emulation packages as well. Eventually, you have to run $env-update and $source /profile to sort out all the dependencies or whatever other problems.
2. Go in /opt/android-sdk-update-manager/tools and run $sudo ./android (you need to be root in order to install the stuff)
3. Install whatever you see fit, I installed Android 3.2 and the Tools
4. Afterwards, go into /opt/android-sdk-update-manager/platform-tools
5. There you'll find the ./adb and ./fastboot commands
6. Now, connect your Xoom trough the USB cable and just let it reboot and reboot and reboot - it doesn't matter
7. Run ./adb devices to see if your Xoom is listed. It should be, mine was listed.
8. To see your directory structure use ./adb -d shell and then you can use ls, cd and cd .. to look around (the -d option says to send the command to the only usb plugged in, so you shouldn't plug more than one device, otherwise you should use -s and the serial number)
9. After you find the directory that's important for you, just download it to your PC. I downloaded stuff from /sdcard doing:
$ ./adb -d pull /sdcard/folder /home/denijane/sdcard/folder
This way I pulled every directory in /sdcard one by one, because the Xoom kept on restarting and I didn't want to miss something, but maybe you can do it as a whole too, I don't know. Just make sure you have checked what you need has been copied to you PC.
10. After you download your stuff from the Xoom, you may Factory Reset it. To do so use: Power + Vol Up to reboot and while the screen displays Dual Core, press couple of times Vol Down to enter the boot menu and with Vol Down scroll until Android Recovery, then use Vol Up to select. After the weird screen shows up, you should press Power + Vol Up (I think) in order to get to the Recovery options. Then, choose Factory Reset and press Power to confirm. After it says Data Wiped, use Vol Up/Down to choose Reboot. That's it.

After you have reseted your Xoom, it's a good time to consider Unlocking it and eventually Rooting it. Unlocking would delete again all your data, so it makes sense to do it on a clean installation. Unlocking is easy, using the tools Motorola has published - you can find a description at http://www.mokonamodoki.com/motorola-xoom-final-rescue.
Yes, unlocking do void you of Warranty, but in some cases you can restore Stock OS and Relock, so I suspect you'll have your Warranty after all. Or maybe not, I don't know. But I was thinking, what's the point in having a cool device as Xoom, if you don't Unlock and Root it. It's just not fair. And it seems that complete Backups can be done only on a rooted device, so I think it's worthy the trouble.
Anyway, I'm so happy I could download my data from the Xoom. And the moral is good - always have important data stored at at least two places!
Have a good day!
Here are some good wikis on ADB:

петък, 17 август 2012 г.

How to install manually latex packages

Ok, TeX and LaTeX have wonderful wikis but still, I'd like to write down the steps I took today, so that I don't forget them.
So, to install those packages you need to:
1. Install TeX from wherever you like.
2. Download the packages from http://ctan.org/search/
3. Following this wiki, you need to unpack the zips to a folder.
4. Then you run latex filename.ins to unpack the styles (and you run it on every file in the folder)
5. If you want the div files with instructions, you can run latex filename.dtx, but I didn't bother with that.
6. Key part: where to put them. Thanks to this site, I found that you can check for the paths of your latex installation using:
kpsepath tex 
kpsepath bst
you can find the paths recognised by your tex installation, Then you need to put the folder with your packages into one of those paths. What I did was:
sudo cp -r ~/Latex/packages/ /usr/share/texmf/tex/latex/
sudo texhash
And that was it. I got all the packages working in no times. Yeah!

A nice way to check whether the installation is good is to run:
fmtutil-sys --all
After an update I had some problems, but it turned out that I had to remove two random files from my packages folder. 

петък, 10 август 2012 г.

How to mask ati-drivers

After the glorious update with ati-drivers-12.6 I turned up without a working video driver. I tried the open-source xf86-video-ati driver and surprisingly it worked quite well - I had 3d acceleration, flawless video and so on. I even managed to sort out the problem I had with kdm not logging in on start up (it was a rather stupid one - after removing ati-drivers and ati-space, the file /usr/lib64/xorg/modules/drivers/fglrx_drv.so didn't got removed and messed up the system - after removing it, kdm stopped complaining about drivers and everything worked fine).
Unfortunately, because of my work, I need to use the ati-driver (oh, well). So I was stuck with a non-working system, doomed to use an "old" driver, and I was kind of upset, because of the whole nonsense ATI put as trough.
Anyway, couple of re-installations later, here's the thing that made me happy:
1. I installed Sabayon 9, which has perfectly working ati-drivers-12.4 on a kernel-3.4.0
2. I masked the packages which could lead to the installation of ati-drivers-12.6 i.e. in the file /etc/entropy/packages/package.mask I added:

Then I ran:
sudo equo update
sudo equo install kde-meta
And I got the newest KDE. Which was quite cool.
Now, if you want to update the kernel to for example >=sys-kernel/linux-sabayon-3.4-r5  I'd rather not. Maybe I did it in a wrong way, maybe not, but doing an sudo equo upgrade rendered my system completely useless, because of some mismatch between the mouse and keyboard drivers. I don't care. I'll just stay with the old kernel and enjoy my life with ati-drivers. Not that I love them so much, but right now, I just have no other option. So far I installed couple of packages (like amarok, smplayer and other stuff) and I didn't run into problems. So as long as you have those packages masked and you stay away from the kernel upgrade, things should be cool. You can even add a mask on the kernel, but when I did that, entropy complained everything gets masked so I removed it. But still, I'm very happy that after 3 days of pain, I finally got my system to work the way I want it to.

понеделник, 6 август 2012 г.

How to disable automatic fsck checks

First, to see the parameters of the checks, you can use:
tune2fs -l /dev/sda1
Then, if you would like to change them:
tune2fs -c 0 /dev/sda1
would disable the checks on maximum count number (for example, on my computer, fsck makes automatic check after 5 reboots).
You can increase the number to say 25 reboots:
tune2fs -c 25 /dev/sda1
Or you can alternatively, set a time limits for reboots using the -i option instead. For example, typing
tune2fs -c 0 -i 0 /dev/sda1
would turn off the checks completely.
For more info, check man tune2fs. 

сряда, 1 август 2012 г.

How to decrease brightness trough konsole

After the last update, it turned out that I cannot control the brightness of my laptop trough the keys. I was quite desperate, but after a day or two of searching, I found the problem. It turned out that in /sys/class/backlight/ I have two folders /sys/class/backlight/acpi_video0 and /sys/class/backlight/toshiba
Trying with echo 0 > /sys/class/backlight/toshiba/brightness turned out not to do the trick, while echo 0 > /sys/class/backlight/acpi_video0/brightness decreased the brightness on my screen. So obviously, my system looks for the screen controls in the toshiba folder.
I noticed this command in the kernel boot screen acpi_backlight=vendor, so I suppose I'll try it on the next restart. But at least, now I can control the brightness. YAY!
While digging the net, I found those two quite cool sites:
http://blog.fejes.ca/?p=510 It offers a script for controlling the brightness (And it works, I tested it).
https://bugs.archlinux.org/task/29543 This is actually a bug report, but you can see some useful kernel options.