Monday, October 10, 2011

Acer Iconia A100 - Mount microSD card from Linux Mint 10 & 11

It doesn't seem AcerSync has anything to do with Linux. If you need to manage directories and files of both internal storage (/mnt/sdcard) and SD card (i.e. /mnt/external_sd) in your A100 from Linux Mint (or other Unbuntu respin), you can try the following:


Install mtpfs & mtp-tools
vpcp115kg ~ # apt-get install mtpfs mtp-tools
vpcp115kg ~ # mkdir /media/a100
vpcp115kg ~ # chmod 775 /media/a100



Mount the storage
Connect A100 to your computer with an USB cable, then
vpcp115kg ~ # date; mtpfs -o allow_other /media/a100; date
Sun Oct 10 20:22:29 HKT 2011
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
Sun Oct 10 20:22:51 HKT 2011
vpcp115kg ~ # ls /media/a100
ビデオ             data       JustReader  Music          pulse           tmp
ビデオ             DCIM       Kobo        myalbum        Ringtones       wwwjdic
Alarms             Download   LOST.DIR    Notifications  SpeedSoftware   漫画
Android            dropbox    lost+found  Pictures       su              音楽
apkinstaller.temp  Evernote   Mikulu      Playlists      Summer Player
astrid             extracted  Movies      Podcasts       TitaniumBackup
vpcp115kg ~ #
 

Certainly you just need to enter the command mtpfs -o allow_other /media/a100
It takes about 30 seconds to mount the storage. You can now manipulate your files from Linux. Just like how you deal with other external media, same rule applies, unmount it before disconnect the USB cable.


Same file / directory name
As both internal storage and SD card are treated as a single transactional file system, directories and files from both locations are combined into a single mount point through mtpfs. If there is a folder called /xyz in both locations, the one from internal storage has preference over SD card. It is kind of odd but I can see the advantage of mtpfs over traditional block device: concurrent access is possible from the mount point and from the tablet.







Friday, September 23, 2011

Acer Iconia A100 - Recovery

As of this writing there is no any official ROM available for Acer Iconia A100. In case you turned it into a brick like I did, you can try the following to recover it.

Update (2011-10-19): There are few official ROMs posted in XDA. I have tried to recovery my A100 (Build version Acer_A100_1.014.08_COM_GEN1) without issue. Recommend to use this ROM instead.



Bare-bones Restore

ROM "Acer_A100_1.022.02_AAP_CUS4"
You can download it from this link (click "联通下载" or "电信下载"), the source is this URL.


This is a Chinese ROM and includes other locales, the majority of packages are version 3.2-1313484170. Please note this ROM does not include common Google packages (Market, MyApps, etc).

Extract the rar file and save the update.zip into the root of a microSD. Use the microSD to recover A100 (hold the volume up key and turn on the tablet, release the volume up key once it starts recovering).

Once it finishes, the tablet should come back to life, at least! Next, do a Tablet erase to have a clean start and establish WiFi connection.



Google Apps Pre-requisite 

System Dump
Download it from this link, the source is this URL.

Most of the packages are version 3.2-150265. Unzip it, we need the app folder, save the app folder to your preferred location in your PC (e.g. /a100/app)


Android SDK
Follow the instructions from android.com.
You need it to install packages. To make life a bit easier, append the following line to the $PATH environment variable in /root/.profile, if you use Linux:
PATH=$PATH:/opt/android-sdk-linux_x86/platform-tools/


Root
You already know how to do it, otherwise you wouldn't ruin your A100. Just follow this thread, then install Superuser and Root Explorer afterward.


Titanium Backup
Install Titanium Backup and take full backup of existing apps.



Packages Comparison

3.2-1313484170 (Acer_A100_1.022.02_AAP_CUS4) 3.2-150265 (System Dump - /app)
AcerAbout.apk AcerAbout.apk
AcerClockWidget.apk AcerClockWidget.apk
AcerDLNA.apk AcerDLNA.apk
AcerNetworkLocation.apk
AcerNidus.apk AcerNidus.apk
AcerOneTimeInit.apk AcerOneTimeInit.apk
AcerRegistration.apk AcerRegistration.apk
AcerSync.apk AcerSync.apk
AcerSyncHelper.apk AcerSyncHelper.apk
AdobeFlashPlayer.apk AdobeFlashPlayer.apk
AgendaWidget.apk AgendaWidget.apk
ApInAp.apk ApInAp.apk
ApplicationsProvider.apk ApplicationsProvider.apk
Aupeo.apk Aupeo.apk
Bluetooth.apk Bluetooth.apk

BooksTablet.apk
Browser.apk Browser.apk
Calculator.apk Calculator.apk

CalendarGoogle.apk
Calendar.apk
CalendarProvider.apk CalendarProvider.apk
Camera.apk Camera.apk
CertInstaller.apk CertInstaller.apk

ChromeBookmarksSyncAdapter.apk
Clearfi.apk Clearfi.apk
Contacts.apk Contacts.apk
ContactsProvider.apk ContactsProvider.apk
DTG.apk
DefaultContainerService.apk DefaultContainerService.apk
DeskClock.apk DeskClock.apk
DigitalClockWidget.apk DigitalClockWidget.apk
DownloadProvider.apk DownloadProvider.apk
DownloadProviderUi.apk DownloadProviderUi.apk
DrmProvider.apk DrmProvider.apk

DTG.apk
Email.apk Email.apk
Exchange.apk Exchange.apk
FDUpdater.apk FDUpdater.apk

Finsky.apk
FWupdateService.apk FWupdateService.apk
Gallery3D.apk

GalleryNew3DGoogle.apk


GameLoftStore.apk

Gmail.apk

GoogleBackupTransport.apk

GoogleCalendarSyncAdapter.apk

GoogleContactsSyncAdapter.apk

GoogleFeedback.apk

GoogleLoginService.apk

GooglePartnerSetup.apk

GoogleQuickSearchBox.apk

GoogleServicesFramework.apk
HTMLViewer.apk HTMLViewer.apk
LatinIME.apk

LatinImeGoogle.apk
Launcher2.apk Launcher2.apk

LinkToFacebook.apk
LiveWallpapersPicker.apk LiveWallpapersPicker.apk
LumiRead.apk
MagicSmokeWallpapers.apk MagicSmokeWallpapers.apk

Maps.apk

MarketUpdater.apk
MediaProvider.apk MediaProvider.apk

MediaUploader.apk
Music.apk

Music2.apk

MusicA.apk

MyLocationWidget.apk
nemoPlayer.apk nemoPlayer.apk

NetworkLocation.apk

OneTimeInitializer.apk
PackageInstaller.apk PackageInstaller.apk
Phone.apk Phone.apk
PicoTts.apk PicoTts.apk

Planner.apk
Provision.apk
QuickSearchBox.apk
Settings.apk Settings.apk
SettingsProvider.apk SettingsProvider.apk

SetupWizard.apk

SocialJogger.apk
Solitaire.apk Solitaire.apk
SoundRecorder.apk SoundRecorder.apk

Street.apk
SystemUI.apk SystemUI.apk

Talk.apk

TegraZone.apk
TelephonyProvider.apk TelephonyProvider.apk
TtsService.apk TtsService.apk
UserDictionaryProvider.apk UserDictionaryProvider.apk
VG_baidumobile.apk
VG_baidusearch.apk
VG_droidreader.apk
VG_gomarket.apk
VG_mapbar.apk
VG_mochi.apk
VG_qiyi.apk
VG_qq.apk
VG_qqlord.apk
VG_renren.apk
VG_sinanews.apk
VG_sinaweibo.apk
VG_sohu.apk
VG_straightflush.apk
VG_tudou.apk

Vending.apk

VideoEditorGoogle.apk

Videos.apk
VisualizationWallpapers.apk VisualizationWallpapers.apk
VoiceRecorder.apk VoiceRecorder.apk

VoiceSearch.apk

WeatherWidget.apk

xt9.apk

YouTubeTablet.apk

Package (Pink) - Packages removed
Package (Light Blue) - Packages installed
Package (Red) - Not able to install (incompatible?)


Cleaning Up
Before I started adding any packages, I did a clean up of bloatware and packages that I don't need through Titanium Backup. Refer to the left column of the table above (Packages in pink colour). Up to this point your A100 should be in a pretty good state (i.e. no any pop-up application errors).


Install Google Apps

Connect A100
Connect A100 to your computer with an USB cable. Make sure the settings below (Setting > Applications):
- USB debugging is enabled
- Unknown sources is allowed

From the SDK, confirm if it can communicate with your A100:
vpcp115kg ~ # adb kill-server
vpcp115kg ~ # adb start-server
vpcp115kg ~ # adb devices
List of devices attached
37c61xxxxxxxxxx device


RW /system

From the SDK, remount the A100 /system into rw mode:
vpcp115kg ~ # adb remount
remount failed: Operation not permitted

If it failed, try the following commands:
vpcp115kg ~ # adb shell
$ su -
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/app
# exit
$ exit
vpcp115kg ~ #


Google Services

From the SDK, install the following apk:
vpcp115kg ~ # cd /a100/app

Install GoogleLoginService:
vpcp115kg ~ # adb install GoogleLoginService.apk

vpcp115kg ~ # adb push GoogleLoginService.apk /system/app
Install GoogleServicesFramework:
vpcp115kg ~ # adb install GoogleServicesFramework.apk
vpcp115kg ~ # adb push GoogleServicesFramework.apk /system/app
vpcp115kg ~ # adb reboot

Once rebooted, the Google Account option should be available under Settings > Account & sync > + Add account
Add your Google account and confirm the connection succeeds before continue.


Install GoogleCalendarSyncAdapter:
vpcp115kg ~ # adb install GoogleCalendarSyncAdapter.apk
vpcp115kg ~ # adb push GoogleCalendarSyncAdapter.apk /system/app
Install GoogleContactsSyncAdapter:
vpcp115kg ~ # adb install GoogleContactsSyncAdapter.apk
vpcp115kg ~ # adb push GoogleContactsSyncAdapter.apk /system/app
Install Gmail:
vpcp115kg ~ # adb install Gmail.apk
vpcp115kg ~ # adb push Gmail.apk /system/app

The options of Sync Calendar, Sync Contact and Sync Gmail should appear under Settings > Account & sync. Test the synchronisation before continue.
 
Install GoogleQuickSearchBox:
vpcp115kg ~ # adb install GoogleQuickSearchBox.apk
vpcp115kg ~ # adb push GoogleQuickSearchBox.apk /system/app
Install MarketUpdater:
vpcp115kg ~ # adb install MarketUpdater.apk
vpcp115kg ~ # adb push MarketUpdater.apk /system/app
Install Finsky (Market):
vpcp115kg ~ # adb install Finsky.apk
vpcp115kg ~ # adb push Finsky.apk /system/app
Install Vending:
vpcp115kg ~ # adb install Vending.apk
vpcp115kg ~ # adb push Vending.apk /system/app
Install YouTubeTablet:
vpcp115kg ~ # adb install YouTubeTablet.apk
Install Maps:
vpcp115kg ~ # adb install Maps.apk
Install Talk:
vpcp115kg ~ # adb install Talks.apk
Install Street:
vpcp115kg ~ # adb install Street.apk


Your tablet should now back to fully functional.







Monday, September 12, 2011

Linux Mint 11 "Katya" on VAIO P - VPCP115KG Part 5 (Experimental)

Aligning Filesystems
As the erase block size has been identified, in order to align with it, the previous partitions / volumes configuration are reconfigured.


Proposed Disk Layout
Partition / Volume Size Remark
/dev/vg00/lv00 9216MB / partition in LV (576 LE)
/dev/sda1 256MB /boot partition
/dev/vg00/lv01 1024MB swap partition (64 LE)
/dev/vg00/ev00 16GB encrypted 16GB partition in LV (1000 LE)
/dev/vg00/lv02 32224MB /data partition in LV (3072 LE)
free space
144 LE free space for snapshot


Factory CHS & Partition Table
I don't bother with the default CHS, instead I create a /boot partition after the first 16MB erase block, both the size of sda1 & sda2 are divisible by 16.
# sfdisk -luM /dev/sda
 
Disk /dev/sda: 7783 cylinders, 255 heads, 63 sectors/track
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start   End    MiB    #blocks   Id  System
/dev/sda1   *    16    271    256     262144   83  Linux
/dev/sda2       272  61055  60784   62242816   8e  Linux LVM
/dev/sda3         0      -      0          0    0  Empty
/dev/sda4         0      -      0          0    0  Empty

# sfdisk -luS /dev/sda
Disk /dev/sda: 7783 cylinders, 255 heads, 63 sectors/track
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sda1   *     32768    557055     524288  83  Linux
/dev/sda2        557056 125042687  124485632  8e  Linux LVM
/dev/sda3             0         -          0   0  Empty
/dev/sda4             0         -          0   0  Empty



Partitioning
Create a LVM physical volume:
# lvm pvcreate --dataalignment 16384k /dev/sda2
Confirm if the PV is properly aligned:
# pvs -o +pe_start
  PV         VG   Fmt  Attr PSize  PFree 1st PE
  /dev/sda2  vg00 lvm2 a-   59.34g 2.25g  16.00m 

Create a LVM volume group:
# lvm vgcreate -s 16 vg00 /dev/sda2
Confirm the PE size of the logical volume:
# lvm vgdisplay /dev/vg00 | grep 'PE Size'
  PE Size               16.00 MiB 

Create a / volume (576 LE x 16):
# lvm lvcreate -n lv00 -L 9216 /dev/vg00
Create a swap volume (64 LE x 16):
# lvm lvcreate -n lv01 -L 1024 /dev/vg00
Create a volume for LUKS (1000 LE x 16):
# lvm lvcreate -n ev00 -L 16000 vg00
Create a volume for /data (2014 LE):
# lvm lvcreate -n lv02 -l 2014 /dev/vg00

Create an ext4 /boot partition:
# mkfs.ext4 -E stripe-width=16384 -b 1024 /dev/sda1
Create an ext4 / volume:
# mkfs.ext4 -E stripe-width=4096 -b 4096 /dev/vg00/lv00
Activate swap partition:
# mkswap /dev/vg00/lv01
Create an ext4 LUKS volume (refer to Part 1 on how to create it):
# mkfs.ext4 -E stripe-width=4096 -b 4096 /dev/mapper/ev00
Create an ext4 /data volume:
# mkfs.ext4 -E stripe-width=4096 -b 4096 /dev/vg00/lv02


Restore
Refer to Part 2 on how to restore the data as well as the boot loader, when necessary.


I/O Scheduler

Edit /etc/rc.local and add the lines highlighted in blue below:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch

exit 0





Everything should be aligned to 16MB erase block, hopefully.




Linux Mint 11 "Katya" on VAIO P - VPCP115KG Part 4

Flashbench
In order to find out the erase block size of bundled 64GB SSD, SanDisk pSSD-P2, different tests were conducted using flashbench. All tests were ran under Linux Mint 11, booted from an USB flash:

mint ~ # uname -a
Linux mint 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux


The following are few offset test results:

Random write test with 16MB erase size










Sequential write test with 16MB erase size










Random write test with 32MB erase size











Sequential write test with 32MB erase size












Various tests were performed and showed the erase block size is 16MB. Thank you for the help and assistance from Arnd Bergmann, the coder of flashbench. Other figures are posted in Linaro.org.



Friday, August 26, 2011

Linux Mint 11 "Katya" on VAIO P - VPCP115KG Part 3

Suspend
It does not work at all, comes back with a blank screen, unable to connect to Vaio from other node. Recommend to change the settings in Power Management to avoid any Suspend action.


Hibernate
No issue found.


Volume Keys
All three function keys F2, F3 and F4 work correctly.


Wireless LAN
No issue found.


Camera
No issue found.


3.5G (HSDPA) Data Connection
Able to connect to internet through my Xperia Arc as a gateway (tethering).

HSDPA connection is detected as usb0 interface












Enable USB tethering in Xperia Arc























Bluetooth
Able to transfer file between Vaio and Xperia Arc.

Vaio is paired with Xperia Arc in Bluetooth

















Xperia Arc is paired with Vaio























SD Memory and Memory Stick Duo
Both type of removable media are detected.


Other Information
Kernel version & release: 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:05:14 UTC 2011

Statistic when powered by AC adaptor:
Startup time: 36 secs (Login screen appears with Disk I/O LED stops blinking)
Login time: 18 secs (Gnome desktop loading completes with Disk I/O LED stops blinking)
Shutdown time: 6 seconds


Statistic when powered by battery:
Startup time: 42 seconds
Login time: 18 seconds
Shutdown time: 6 seconds




Thursday, August 25, 2011

Linux Mint 11 "Katya" on VAIO P - VPCP115KG Part 2

Backup
I use an USB hard disk cradle to store backup dump files. The hard disk is formatted in ext4 filesystem.
Prerequisite is to install dump utility first:
$ su -
# apt-get install dump


Let's create a snapshot:
# lvcreate -l 563 -s -n lv99.fss /dev/vg00/lv00
Start backing up / filesystem (assume the USB disk is mounted under /media/backup):
# dump 0uf /media/backup/20110822-vpcp115kg-lv00.dmp /dev/vg00/lv99.fss
When it completes, delete the snapshot:
# lvremove -f /dev/vg00/lv99.fss


The / backup takes 6 minutes 42 seconds.

Let's create a backup of /boot partition:
# dump 0uf /media/backup/20110822-vpcp115kg-boot.dmp /dev/sda1


The /boot backup takes 2 seconds.

The first backup we used snapshot, the second backup we did not use, actually we cannot use snapshot because /boot partition is not a logical volume. We use snapshot because we want a solid backup that we can restore it later. Since / filesystem is an active partition (try umount it), using dump might not guaranty a successful restore (the restore might be fine, actually), but the OS might have problem due to file inconsistency. On the other hand, /boot partition is not considered active, you can try umount it after the OS is up. Or umount it before taking backup.


Restore
To restore the / filesystem due to whatever reasons:
- Boot Katya using the boot media (the USB flash drive) with active network connection.


When Katya is ready, connect the backup media (assume it is mounted under /media/backup), then open a gnome-terminal:
$ sudo su -
# apt-get install lvm2 dump
Activate logical volume lv00:
# lvm lvchange -a y /dev/vg00/lv00
Wipe logical volume lv00:
# mkfs.ext4 /dev/vg00/lv00
# mkdir -p /media/lv00
# mount /dev/vg00/lv00 /media/lv00


Start restoring / filesystem:
# cd /media/lv00
# restore rvf /media/backup/20110822-vpcp115kg-lv00.dmp
When the restore completes (it takes about 10 minutes):
# sync
# rm restoresymtable
# cd /
# umount /media/lv00
Run a filesystem check against logical volume lv00:
# fsck /dev/vg00/lv00


Ignore this step if it is required to restore /boot filesystem, otherwise just issue the following two commands and stop.
# umount /media/backup
# init 6

Retrieve the UUID of /dev/sda1:
# blkid | grep '/dev/sda1'
/dev/sda1: UUID="e80248bf-2417-4d66-a104-b8dce0e34c71" TYPE="ext4"
To restore the /boot filesystem:
# mkfs.ext4 /dev/sda1
# mkdir -p /media/sda1
# mount /dev/sda1 /media/sda1
Start restoring /boot filesystem:
# cd /media/sda1
# restore rvf /media/backup/20110822-vpcp115kg-boot.dmp
When the restore completes (it takes about 20 seconds):
# sync
# rm restoresymtable
# cd /
# umount /media/sda1

Disconnect the USB backup media:
# umount /media/backup
Since /dev/sda1 was wiped previously, need to re-install GRUB2:
# mount /dev/vg00/lv00 /media
# mount /dev/sda1 /media/boot
# grub-install --root-directory=/media /dev/sda --force
# sync

Assign the old UUID to /dev/sda1:
# tune2fs /dev/sda1 -U e80248bf-2417-4d66-a104-b8dce0e34c71

Umount restored filesystems
# umount /media/boot
# umount /media
Run a filesystem check against /dev/sda1:
# fsck /dev/sda1
Deactivate logical volume lv00:
# lvm lvchange -a n /dev/vg00/lv00
# init 6


If you re-install GRUB2 previously, run the following command after reboot:
# update-grub

The OS is back to the previous stage of the last backup.


Intel EMGD (GMA500 driver)
There are four commands to enter (for more information, please refer to the instructions found in Ubuntu wiki "Poulsbo" 2.1):
# add-apt-repository ppa:gma500/emgd
# apt-get update
# apt-get install xorg-emgd emgd-dkms emgd-xorg-conf
# emgd-xorg-conf


Don't reboot yet, copy the configuration from this page and save it as /usr/share/X11/xorg.conf.d/10-emgd.conf, then go ahead to reboot:
# init 6


Once it is rebooted, Compiz can be activated!


Brightness Function Keys Fix
Install emgdbl package:
# apt-get install emgdbl


Edit the following line in /etc/default/grub (added settings are highlighted in blue):
GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=video mem=1920mb"


Append the following line in /etc/modprobe.d/blacklist.conf:
blacklist poulsbo

Append the following line in /etc/initramfs-tools/modules:
emgdbl


Generate a new initramfs image:
# cd /boot
# cp -p initrd.img-2.6.38-11-generic initrd.img-2.6.38-11-generic.20110825
# mkinitramfs -o initrd.img-2.6.38-11-generic

# init 6

After reboot, the F5 & F6 keys are resumed.


Other Little Hacks
Disable tty2 - tty6 by editing /etc/init/tty[2-6].conf:
Comment the following line:
#start on runlevel [23]


Disable the following services from Startup Applications Preference in Control Panel:
- Bluetooth Manager
- Dropbox
- GNOME Login Sound
- GSettings Data Conversion
- mintWelcome
- Personal File Sharing
- PulseAudio Sound System KDE Routing Policy
- Visual Assistance
- Zeltgelst Datahub


In Keyboard Shortcuts, assign Launch web browser action to the "WEB" key. Once it is assigned, the default browser will be launched when you press the "WEB" key in Gnome.