Apps | Hardware | Setup | Network | Hacking | Wishlist | Top |
Web links:
CyanogenMod is a hacked image actively maintained by Steve Kondik
Cyanogen
and a voluteer hacker crew. It is widely used, having about
3.5e5 official
installations, and is well regarded. But compare to
5.5e5 activations per day of phones running Android.
From AndroidCentral quoting Larry Page (Google)'s
earnings announcement, dated 2011-07-14.
We can consider saving some development sweat by trying to use CyanogenMod assuming it has the wanted features. CyanogenMod-6 supports the HTC Dream (G1), is based on Froyo (2.2), and is dated 2010-08-28. CyanogenMod-7 is based on Gingerbread (2.3.3), dated 2011-04-11. Unfortunately it does not support the HTC Dream (G1). Already with Eclair it needs to move partition boundaries; the Dream is standardly configured with 64Mb in the /system partition, and CyanogenMod 5 and above won't fit, according to the DangerSPL page. A recent comment poster says he has CyanogenMod (version not stated) on his G1 (HTC Dream).
List of features in CyanogenMod (there are additional features of a non-sexy nature that aren't listed):
What do the CyanogenMod docs say about support for jimc's existing hacks? (See below for the actual situation.)
Real filesystem on SD card: You need one VFAT partition, but additional partitions are mounted and can be ext2,3,4 or swap. OK. But there's a problem mounting them at boot. [Fixed.]
Google Gears with storage on the SD card. This hack would have to be re-done, but it's simple, just a symlink.
My backup script must continue to work, which requires Busybox. CyanogenMod has Busybox -- OK. And with Dropbear I can make a remotely executed backup script.
X.509 root certificates from work and home. There is a cert installer associated with the certificate's mime-type. OK. Certs are installed, but not used. I ended up repeating the root CA installation hack.
ADB to run as root -- OK (this is a hacker image). ADB can also remount /system read-write, which it couldn't on Cupcake.
I would also like Dropbear but I don't see it listed. Nonetheless the support docs say CyanogenMod-5.0.6 and above have it. Yes, it works and can be started at boot.
I wanted, but never got, IPv6. CyanogenMod has the module and will configure a RFC 2462 address on receiving Router Advertisements. (Don't know about DHCP6.) You can chatter to its IPv6 address and it (web browser and dropbear SSH client) can chatter with local and WAN sites such as ipv6.google.com.
The Recovery image is a mini-system with just enough brains to write
a software package to flash.
The one most often mentioned is Clockworkmod Recovery
;
it is available from the Android Market and includes the payload image.
The wiki page for the
HTC Dream suggests that the Amon-Ra Recovery works better on the Dream.
Clockworkmod Recovery is maintained by Koushik Dutta
;
could this be the Budins' son-in-law? Photo doesn't look like him.
Koush suggests using (his?) ROM Manager 4.4.0.3. This program is included in CyanogenMod (not sure of the version).
The plan is to put CyanogenMod onto the phone, see what it really is, and then try to get my stuff working.
Upgrade plan:
Make an up-to-date list of installed packages, total 70 listed by the package manager, some are grouped in the lists below.
These are from the market and I want to keep them (16 items):
EM Dev(free). Does PDF, DjVu, XPS, comic books. [Test OK on PDF.]
I still need to download and/or dispose of these 4 items:
New items with this upgrade:
Cupcake.
These were from the Market and have all been tossed (6 items):
These are provided by Google (on Cupcake) (41 items):
Do a standard backup. [Done]
Obtain ROM Manager and back up everything using it. (Unfortunately ROM Manager (or competitors) is not available for Cupcake. Step omitted.)
Obtain Clockworkmod Recovery which should include CyanogenMod. Verify versions. Obtain the right version if needed. [Done except it's Amon_Ra's Recovery; see below for versions.]
Sad news: CyanogenMod on the HTC Dream only goes up to version 6.1. No Gingerbread. Same as on the stock Android kernel.
Wiki page (see below) says Clockworkmod Recovery doesn't do well on the HTC Dream; use Amon_Ra Recovery instead.
Save SD card content on the laptop. [Done]
Put in the 128Mb SD card formatted with FAT32, with the images. [Done]
Upgrade the OS. Details below. [Done]
Switch to the 8Gb card and reformat it with ext4. Restore the content. [Done.]
Upgrade all upgradeable packages. [Done.]
Check out the relevant features. [Done.]
Figure out where to go from there.
This is summarized from CyanogenMod's HTC Dream product page.
It's recommended to fully charge the battery before starting these steps. Loss of power in the middle of flashing could cause widespread corruption, requiring JTAG to get out of (good luck!) It seems to be bad mojo to run the charger, most likely because you need working firmware to turn it on.
Step 0: make a normal backup of your phone.
Step 1: r00t your phone. With the Dev Phone 1 this is already accomplished.
According to the wiki page, ClockworkMod Recovery is not
recommended for the Dream. Please upgrade to Amon_Ra.
Where to get Amon_Ra's recovery program:
Read forum posting; the download links are after the usage
instructions.
If you have an engineering SPL, as on my Dev Phone 1, here is the procedure to flash using fastboot, according to Amon_Ra. Android Wiki article about fastboot.
Power off the phone, disconnect the charger, then boot while
holding down the Back button. This gets you into fastboot mode.
You confirm it by a screen image with robots on skateboards.
(Most people recommend holding down the Camera button but Amon_Ra
mentions the Back button, and it worked for me.) The middle screen
line says serial0
.
Connect the G1 via USB to a computer. The middle screen line will
change to FASTBOOT
. This is like the connection for adb, but
you're going to use the fastboot program. To get it, you will need to
have built Android already. (Or see the Android Wiki article linked
above for a link to a prebuilt instance.) On my system its filename is
/home/jimc/android/android-1.5/out/host/linux-x86/bin/fastboot The
following instructions assume it's on the path (not likely); I just
used the full path name.
fastboot devices
-- This is to make sure it's working. It
should print the serial number and mode (fastboot) of your phone.
fastboot flash recovery recovery-RA-dream-v1.7.0.img
--
Command line arguments are: flash (copy an image to flash) recovery
(which partition to copy it to) filename.img (filename of the image
on the host computer, full or relative path is OK).
Fastboot will copy it over
USB to the phone and flash it. Takes about 5 seconds; transfer size
is reported as 4594 Kb, probably varying with updates.
fastboot reboot
-- Reboot normally. You can also press
green-menu-red (all at once) to reboot. Green is the make/accept
call button; red is the power/decline button.
For some unknown reason, after the first reboot the Amon_Ra Recovery image was not loaded (the original one was). I had to do it over. Very likely it's necessary to power off the phone for the recovery image to be used. Second time, it's there.
If you rooted your phone but didn't put the engineering SPL on it, use this
alternative. (CyanogenMod-5.0.7 has a bug precluding this method.) Copy
recovery-RA-dream-v1.7.0.img to the root of the SD card. Jimc's suggestion,
don't tempt sleeping dragons, use a card formatted with FAT32. Start the
phone's terminal app, su root
, then flash_image recovery
$filename
.
If you have a cooperative Recovery program, you can use that to flash the replacement Recovery; see the procedure below. But Amon_Ra recommends to use fastboot if at all possible.
If your radio version is not on the compatibility list for DangerSPL, download the right one (9.2Mb) and install it now using Recovery (procedure shown below). However, people recommend using fastboot instead of Recovery. Unfortunately fastboot doesn't know how to unzip a package. In any case, my radio already has the right firmware so I'm going to not re-flash it. [Phone survived.]
Next, install the DangerSPL, which is the SPL (second program loader, kind of like Grub stage 2) off the closely related HTC Magic. Wiki page for DangerSPL. You need this because the native SPL can only handle 64Mb system images and CyanogenMod-5 and 6 are bigger than this; DangerSPL can handle up to 96Mb. Caveats:
You must have compatible radio firmware. If you don't, you will brick your phone.
To check, fastboot by holding the camera button while powering on the device. We have HBOOT-0.95.3000 and radio 2.22.19.26I. We don't have (do need) DangerSPL. This radio is compatible; it is for non-USA phones.
In this forum post about bricked phones dated 2010-03-30, lbcoder tells his theory and evidence for what's causing it, and recommends strongly that only fastboot should be used to flash the radio and the SPL.
However, fastboot doesn't know what to do with a zip file, whereas Recovery does. The image file is inside the zip file, but I was too chicken to extract it and send it to fastboot. I ended up using Recovery. See the procedure below.
To obtain the various files, see the CyanogenMod Wiki product page for HTC Dream. It has links to howto's and index pages, which is where you find the links to the files themselves. Download them and put them in the root of the SD card. I mounted the SD card on my laptop to do the copying. Here's a list of the file basenames you want, as of this writing (2011-09-05), but it's possible (likely) that versions may become updated. Note: you need the Google Apps file that goes with your CyanogenMod version, and for CyanogenMod-6 and earlier you need to get the correct Google Apps variant for your phone. I got into a horrendous tangle by using gapps-mdpi (not tiny) which is the wrong one.
It's better to use fastboot to install the first two, but I wasn't able to make this happen. Install the zipped images using Recovery, in the order given. It is probably necessary to use the Amon_Ra Recovery program in order to adjust the image size. Android Wiki article about Boot Modifiers including keyboard commands for Recovery. But Amon_Ra Recovery can do a lot more things.
Insert the SD card in the phone. (I use my laptop to copy the image files onto the card.) Leave the keyboard exposed.
Boot Recovery by holding down Home, then press Power (when powering
on the phone). It shows the Android
text logo for a while, then
the Recovery logo/menu. For the standard engineering Recovery, it's
an image of triangle! and a phone. Amon_Ra Recovery will show its
action menu.
Before loading CyanogenMod it is probably a good idea to wipe user
data and the cache (called factory reset
). You did make a
backup, didn't you? Select from menu, or Alt-W.
Select the appropriate zip file. Do it in the order listed above.
With Amon_Ra, you press Alt-F or select Flash Zip from SDcard
(use trackball to scroll, click it to select). It will show a list
of available zip files in the root of the SD card. Select the one
you want. It will ask for confirmation, press Home key. Installing
the big CyanogenMod image takes 2 or 3 minutes.
You will see a lot of forum postings with elaborate instructions how to rename the desired file to update.zip, then get into Recovery and hit Alt-S. This is for the standard engineering Recovery program, which would also work on a phone with a 96Mb system partition, but not for the Dream.
At the end it tells you to reboot, at least on the SPL. Do so, To do the next file, hold down Home as you click, to get back into Recovery. It is probably not necessary to reboot after doing CyanogenMod, before Google Apps, but for paranoia I did it anyway.
On the first boot, everything takes extra time because it has to initialize things. It took fully 4 minutes before the desktop appeared.
It has a cute CyanogenMod animation when booting.
If you wiped data, it will start in the setup wizard. This gives you a very brief tutorial, then asks for your Gmail loginID and password. If you don't have an account you can create one, or you have the option to skip this. Then it asks for some security settings, and fires off the syncer.
The user interface and settings are generally similar to standard Android but with modifications and improvements.
The standard lock screen has the clock and two controls. The one with a loudspeaker icon: swipe it to the left (all the way across) to make the phone silent. The one with the lock icon: swipe it to the right to unlock.
Initially I had trouble mounting the SD card. This forum post about SD card formatting by Kevin Purdy (2009-09-01) gives a hint what the problem is: you absolutely need the first partition to be VFAT. Then an ext3 or ext4 partition, then a swap partition (optional). These two can be in either order. I'm going to give it:
Failed procedure to format the card on the phone:
Insert the unformatted or incorrectly formatted SD card in the phone.
Connect the USB cable.
Android pops a notification. View your notifications. Click on
the USB Storage
notification. Select Copy files to/from
your computer
. The resulting process will continue running
until you finish.
The host will recognize a new USB storage device and create a disc inode for it; in my case, /dev/sdb.
parted /dev/sdb
-- Partition your disc in the normal way.
Well, that was a bust: parted says no media found
.
/dev/sdb represents the VFAT partition; you're supposed to mount it sort of like a floppy, and then copy files on and off.
So I did the partitioning on my laptop. Now it mounts the FAT32 partition, but not the ext4 or swap.
I re-did the partitioning using Amon_Ra's recovery; the partitions come
out in the above order. It still mounts only the FAT32 partition.
/system/etc/vold.fstab has a line for only that partition, in an unfamiliar
format involving a path within /sys. Should I hack
fstab? I'm going to defer this issue until later; see
Miscellaneous Setup
. [Eventually fixed.]
Storage statistics (before installing market apps): total NAND flash storage: 89.75Mb; available space: 55.01Mb. Pretty svelte.
Open the Settings app via Menu/Settings. Going through all the settings -- these notes indicate only the ones that I altered, except when the default is notable.
Wireless and Network:
WiFi: On; and configured access point. Note: if you have WiFi on and are not in range of a connectable access point, the OS will do repeated wireless scans, which eats battery: almost half of capacity in 8 hours. Use your widget (see below) to turn it off.
VPN: Need to test this, but later. See below for procedure. Successful.
Call Settings:
Voicemail Settings: leave on My Carrier
;
According to
Brian's blog,
the voicemail number is 310 226 1234 (switch: BRBNCAOBCMD);
however, the phone decided
it should be +1 619 204 0806, which I vaguely remember is correct
for AT&T. Indeed, this number can be used to retrieve my
voicemail.
Defaults are to vibrate on answer and hangup. I turned on
keep screen awake
and show nick/organization
.
There is a section to blacklist particular numbers.
CyanogenMod Settings:
Input settings: I turned on menu unlocks the device
.
Under User Interface:
Status Bar: I turned on battery
percentage
, yay! I also set its color to greenish cyan,
which contrasts readably with all the various background
colors: green on a mostly charged battery, black if mostly
discharged, white and red if below the alarm level.
Also Show dBm. This is the cell tower's signal strength. The status bar rearranges annoyingly when this jumps from -103 to 0 (AT&T's poor signal at my house), but I would rather know what the issue is.
Widget buttons: the default includes on-off switches for Wi-Fi, Bluetooth, GPS, sound. I added brightness and mobile data. To see the widgets, swipe down starting in the status bar; they are in the top row of the expanded status page.
Rotation: Default is 90 and 270 degrees, I also picked 90 degrees: if you hold the phone with south up (button end), the screen will rotate to match.
Screen timeout delay: 10 mins. When the screen times out, how long do you keep the screen unlocked? After that, the user will have to give the lock pattern, password, etc.
Screen turned off delay: 10 mins. Same thing except for pressing the go-to-sleep button (red power button).
Anonymous statistics: I drank the Kool-Aid.
Sound Settings:
Phone Ringtone: Ding
. Other non-music tones are
Digital Phone
and Bell Phone
.
Notification Ringtone: Missed It
is the default; this
is the same as in standard Android. Some others might be better.
Display Settings: Screen timeout 2 mins (default is 1 min).
Location and Security:
Use GPS (turned on).
Screen Lock: Turned on.
Credential Storage: Enabled this (it wants the password). I copied these certs to the SD card and installed them:
However, this does not install them in the certificate store used (by the web browser) for SSL/TLS, so it doesn't do much good.
Accounts & Sync: I turned off Background Data. The machine was shooting off about 0.2 watts continuously syncing my Gmail, Google Calendar and contact list (all empty), and the battery would barely last half a day, while a full active day was normal performance on Cupcake. It looks like I'm returning to my accustomed battery life.
Now when I want to sync, I would open Settings / Accounts&Sync / Manage Accounts, and then click on the type of data I want to sync.
The Market wants Background Data turned on, so I activate it when using the Market, then turn it off again.
I previously completely suppressed cellular data, with a comparable energy saving, but that is too radical of a cutback.
Date and Time: picked 24 hour format; date format yyyy/mm/dd (strict ISO 8601 with hyphens is not available).
Wallpaper (long press in home screen background, or it's on the menu key's menu): Cyanogen wallpapers #2, the skating droid on colored shale. They don't have the standard wallpapers, at least the ones from Cupcake.
Here's the procedure to use an externally generated picture, specifically android-2.1/packages/apps/Launcher/res/drawable-hdpi/wallpaper_sunset.jpg (or any version that I have from 1.5 to 2.3):
At least for the 480x320 screen (MDPI) of the Dream, the photo should be 640x480px in size. JPEG is acceptable; I don't know which other formats it can handle. If the size or aspect ratio is wrong, the Gallery app will let you crop or scale it.
Copy it to the SD card's VFAT partition, possibly in any subdirectory.
Hit the Menu key; Wallpapers; it asks complete action
using file manager or Gallery
. I tried the file manager,
but after I selected the item, the response was not recognized
and the dialog box popped up again. Trying Gallery:
Give it a moment to search for displayable photos. Find the one you want. Tap it.
The gallery app will show a larger image with a crop rectangle. Drag the edges to cover the entire photo, unless you actually want to show only part of it. Hit Save.
It will scale the cropped image and save it to some hidden place, and use it as the desktop wallpaper.
Clock: Set up alarms. Using Rooster Alarm
for the ringtone.
Page 0 (Center)
| |||
Battery Usage | Market | ||
Clock | Amazon Kindle | Music | |
Jota Text Edit | Google Maps | Tricorder | |
Page 1 (Right)
| |||
RealCalc | |||
K-9 Mail | Contacts | Calendar | OpenVPN |
Out of Milk | CadreBible | ConnectBot | Terminal |
Page -1 (Left)
| |||
Andoku | Lexic | Gallery | Camera |
Summarizing the CyanogenMod wiki page on SSH:
It's assumed that you have your personal private and public SSH keys. If not, the wiki page shows how to create them. Copy the public key to any convenient location on the phone, like the SDcard.
Use your favorite hacking tool, like ADB or the terminal app.
On CyanogenMod, ADB's shell is automatically run as root; otherwise use
su
to get root. All of the files below should be owned by root.
Your umask is 000, so be sure to fix the modes of the files created.
Create /data/dropbear (mode 755) and /data/dropbear/.ssh (mode 700).
Copy (or append) your public key to authorized_keys in this dir (mode 600).
Generate the host key(s):
The page says dss, not dsa; it has a fixed size of 1024 bits.
Determine the IP address of your phone. Determine the interface names
by either of: ls /sys/class/net
or cat /proc/net/dev
.
On the Dream, wireless is tiwlan0 while the cellular data interface is
rmnet0, 1 or 2 (guess which). These names vary between devices.
Now do ifconfig tiwlan0
to get the IP address. If the phone is
napping it may have shut off WiFi; if so, wake it up.
Manual operation of Dropbear for testing. Run dropbear with these command line options: -s = no passwords accepted, publickey only. -v = verbose output, -F = no daemon, stay in foreground. It will use the default key files, which are the ones you just created.
Now try to slogin to your phone. For me it worked the first time, with much verbosity in the debug output. If the sending host already has a (different) host key in ~/.ssh/known_hosts, you will get a nasty message, including the line number. Get rid of the obsolete key and try again.
For normal operation you can start it when needed by just
dropbear -s
. Recommended to redirect stdin-stdout-stderr because
otherwise it holds open your TTY and you can't exit from the ADB shell
until you kill Dropbear.
To make it start at boot, do this:
mount -o remount,rw /system
Append this stanza to /etc/init.local.rc (actually in /system/etc):
# start Dropbear (ssh server) service on boot service sshd /system/xbin/dropbear -s user root group root oneshot
This done, Dropbear starts at boot, and I can execute commands and get a shell session on it, using its IPv6 (or IPv4) address, just like a normal host. Yay!
I restored my backed-up web materials, that formerly were on the SDcard of Cupcake. I edited the home page removing the Google Gears hack; the version of Gears that I'm using is obsolete and needs to be upgraded, but not today. A URL of file:///sdcard/jimc-web/index.html was honored by the browser and was functional as my home page -- unlike on Cupcake where the developers, in a fit of unjustified paranoia, suppressed file URLs.
The only problem was that I use some symlinks to indices of contained directories, and FAT32 does not do symlinks. So I duplicated the referent pages instead, hiss, boo.
To import the CFT Root Certificate I simply navigated to the link to the cert (mime-type application/x-pem-file) and clicked on it. A dialog box opened asking for the friendly name of the cert, and certificate storage had no password yet so it asked for it to be set. It reported that the downloaded object had one CA cert (correct), and that was that. But this certificate was not honored for SSL/TLS connections (by the web browser).
To watch out for: how do you change the password for the Java certificate store? (Settings/Location and Security/Certificate Store.) Also, how do the trust vendor certs get updated, e.g. to remove the compromised cert for DigiNotar?
Here's a forum post from omegat on how to import certs the right way (on Donut or Eclair). Here's the procedure (in the 4th unit):
Eventually I repeated the procedure I developed on Cupcake to import certs into the system keystore. That was effective: my home and work certificate authorities are now trusted.
CyanogenMod-6 comes with OpenVPN preinstalled. (Not sure when it came in; I think CyanogenMod-5.) If you have the stock Android, a rooted phone, and a tun.ko module compatible with your kernel (that's the hard part), you can install OpenVPN from the Market. Recommended to just upgrade to CyanogenMod.
I installed OpenVPN Settings and OpenVPN Installer by Freidrich Schäuffelhut, from the Market (free; the latter is ad supported). The two OpenVPN GUI packages don't look promising; they appear to attempt to install their own binaries, two different ones.
CyanogenMod includes the OpenVPN binary, the tun.ko network tunnel module, and a settings module, found in Settings / Wireless and Net / VPN Settings / Add VPN / Add OpenVPN. I believe that stock Android-2.2 does not have any of this, but you can install them from Market packages. To load tun.ko requires root access, that is, r00t your phone.
I was able to create a configuration that would connect; however, the
provided configuration does not pull
settings like the MTU from the
gateway, and the cipher and HMAC algo must match exactly and cannot be pulled,
but there is no way to influence them in the client, so no data can be
transferred and the connection eventually dies.
These are the specific complaints, in the unlikely case that you are able to adjust the gateway to match what the stock client wants to do. The client wants a MTU of 1541 bytes; it does not do LZO compression; it uses the BF-CBC cipher (Blowfish?), and it uses SHA1 for HMAC.
I turned to OpenVPN Installer, which you execute as an application
.
It opens with a settings-type dialog. It wants to see /sdcard/openvpn/ populated
with certs and *.ovpn. The latter is
the configuration file extension expected by this program. I installed
these files from /etc/openvpn on Jacinth, which works:
Procedure:
rememberis marked so you only have to do this the first time).
Here are some details:
edit ovpn file. The editor is not elaborate but you can fix a misspelled filename, for example.
adb logcat > /tmp/andr.log &(in the background). Then view the log which is continuously appended to that file.
mlockcommand but that system call is not available. Ignore the warning.
On Cupcake I used Jabiru as a XMPP client, but it appears to be discontinued. I replaced it with Xabber by Redsolution (free). The server on CFT reports that it was making connections (probably meaning that TLS negotiation succeeded; it was configured for TLS), but it could not authenticate. It requires a saved password, hiss, boo!
Trying Beem. People say good things about it. But it requires a saved password. It force closed when connecting to my server. Uninstalled.
Trying Yaxim. Same issues as with Beem. Requires a saved password. Could the server be messing it up? Somehow it sets itself up to start at boot, and it tries to connect to the server without being explicitly turned on. That's going to eat battery. Uninstalled.
These three are the only reasonable XMPP clients on the Market. I need to get XMPP working, but I need other things first, so I'm deferring this issue.
Results of my standard web browser test:
Type | Class | Result |
---|---|---|
JPEG | Image | Shown properly |
PNG | Image | Shown properly |
GIF | Image | Shown properly |
Text | Downloaded; you start EBookDroid (reader) by clicking the notification | |
WAV | Audio | Downloaded, click notification, it plays |
OGG | Audio | URL was sent to the music player, which dies |
MP3 | Audio | URL was sent to the music player, which plays it |
Theora | Video | URL was sent to the music player, which dies |
SWF | Video | Downloaded, click notification, nothing happens |
RPZA | Video | Downloaded, click notification, says this video cannot be played |
AVI | Video | Downloaded, click notification, says this video cannot be played |
Java | Applet | Was not executed |
M3U | Playlist | Unrecognized by browser |
ZPL | Playlist | Unrecognized by browser and music player |
This is using the stock player, and not through the web browser. It is not possible to type in a URL in the media player; you have to go through the web browser, or else deposit music files on the SD card by other means.
Procedure to copy media without wires: Get a SSH session on Selen, display on laptop. Using the laptop's web browser, get the URL to the TAR file of the desired album; see below for accepted formats. It will be about 60 to 70Mb each. On Selen:
cd /sdcard/Music
wget -O - $URL | tar xf -
How does the music player know where the music is? cd
elsewhere,
then unmount the SD card (Settings / SD Card / Unmount), then remount it.
The music indexer will be run.
This hogs the CPU, so give it a minute or two.
To play the music: My albums include pre-made playlists, with tracks in the
correct order. Start the music app. Pick the Playlist tab. Long-press on a
playlist filename. Pick Play
from the context menu.
Alternatively, pick the Album tab. Click on
an album's name. The list of tracks is shown, not necessarily sorted
lexically, in the form of a playlist. Click on one track and it will be
played; or more typical for my usage, hit Menu / Play All. A shortcut for
this action is to long-click on the album's name and pick Play
.
The playlist is expected (or at least is acceptable) in M3U format (extension .m3u). The content may/must be relative filenames, relative to the playlist. The content may be in Ogg Vorbis or MP3 format; others are promised but I did not test them.
If the playlist contains a URL to a streaming audio site, it is removed! Hiss, boo!
I partitioned my SD card with (in order) VFAT, swap, and ext4 partitions. The VFAT partition is mounted at boot; the others aren't. I deferred the issue of getting them mounted, to this point.
The intended design in CyanogenMod-6.1 (I am not sure how much of this is
inherited from the stock Android-2.2 Froyo
) is that the scripts in
/system/etc/init.d/* are executed one by one (in lexical order) as a very
early step in booting. Once all of these finish, vold starts (though I haven't
found the invocation). One of these scripts is 05mountsd. It waits up to
6 seconds for /dev/block/mmcblk0 to appear. It goes through the partitions
on this device, and the first one of type 83 (any Linux filesystem) is
checked and mounted, if there is one.
The fly in the ointment is that vold creates the inodes for both /dev/block/mmcblk0* etc and /dev/block/vold/179:[0-9] etc (the same referents). Thus 05mountsd waits however long, exits having done nothing, and vold then creates the devices.
I did these hacks:
Deactivated /system/etc/init.d/05mountsd by changing the mode to 640 (not executable). It is then ignored.
Copied a hacked version to /data/local/bin/mountsd . Local copy of this script.
Turned the script into a service
by adding this stanza
to /system/etc/init.local.rc . The service is started (once) whenever
init feels like it; the log messages appear early, just after vold
starts up.
# Mounting the additional partitions on the SD card (jimc/CouchNet hack) service mountsdext /data/local/bin/mountsd oneshot
The script was hacked to also search for a swap partition, and to add the first one found. This was effective.
The ext and swap partitions are not unmounted when you use Settings to unmount /sdcard. If you want to remove your card, you need to unmount them by hand. Hiss, boo!
The partition (independently verified to be ext4) is mounted as ext2! Busybox mount is stupid: it apparently tries all filesystem types in /proc/filesystems (excluding nodev), and ext2 appears earlier, and (amazingly) succeeds. I hacked the script to try the filesystem types in reverse order. Fixed.
Once I have CyanogenMod-7.0 running on my new pocket computer, I should verify that the same issues are present, and should send this in as a bug report.
Now that I have CyanogenMod stabilized, I want to restore user data from Cupcake, wherever the format is compatible or reasonably hackable. In particular, I want my contacts back. Here is a list of saved databases. On Android, an extension of .db always cues a SQLite database.
I re-created these by hand; no need to restore.
In Cupcake the format is about as distant from vCards as you can get: separate tables for many of the aspects such as the phone numbers, street addresses, and photos. In NCCN (Froyo) the database is found in /data/data/com.android.providers.contacts/databases/contacts2.db which has a different but equally messy format. It won't be possible to just copy the contacts, even by a minorly clever Perl script.
The correct solution is cloud sync, but my Sogo server was not ready to take the Cupcake information.
The job will be done most promptly by stupid re-entry by hand, using the database dump as input.
On Cupcake I had a script that copied all relevant stuff to /sdcard/BackupRoot, and a cockamamie procedure would transfer it (by sneakernet) to the backup server. On my normal Linux boxes I have a script called backup-host which I execute from the central site by SSH, and I hope to make that work equivalently on the Android machine.
After I installed CyanogenMod-6.1, I got these very annoying symptoms:
Forum postings suggest that this is a syndrome, and a fix for one element fixes the others too.
Cause and Solution: I was using the non-tiny version of Google Apps. When I did a factory reset, re-flashed CyanogenMod-6, and used gapps-mdpi-tiny-20101020-signed.zip (the correct Google Apps for HTC Dream), it ran the setup wizard as it should, the Home button goes to the home screen, I can receive incoming calls, and the UI has stopped crashing. The following material is kept for historical interest.
In a Google search for
cyanogenmod home button not working
, this forum post
(OP jsam69, 2010-09-01)
indicates that re-flashing the Cyanogenmod image will fix it.
Works for some people, not for others. Another item in the same
thread from (anonymous) says to run the terminal emulator, type
bin
and press the home button. Doesn't say what's supposed
to happen then.
In another thread (2011-06-13), the problem was caused by restoring apps using Titanium Backup and indiscriminately restoring the data for everything. They haven't found out which app's data is poisonous but it appears to be a system app.
At the end of this thread, the person says he went into recovery
and fixed permissions
and this helped. The Amon_Ra Recovery has an
action item to fix permissions; basically this sets a bunch of directories
to mode 755, where some of them formerly were not world readable. (Didn't
help me.)
OP WaVeS (dated 2010-04-28) says he has lost his home button. One
respondent says he had this symptom repeatedly (on a G1). Boot into
recovery (power off, hold down home and power on). Do a full
wipe
, then reboot. Fixed the problem every time. (What you're
really after is to wipe cache and data.) It didn't help me.
OP says if he blows cold air onto the home button, it would work.
Do a factory reset and reflash the image. It works again. Another
procedure: Install AnyCut
from the market. Execute it.
Run Setup Wizard. Go through the procedure. This should fix your
dial (green), home, hangup (red) keys gone wacko.
JoshuaE says (paraphrasing): Make /data/data/com.android.providers.settings/databases/settings.db available on a real machine. Use sqlite to insert a record with name=device_provisioned value=1. Copy it back to the original location. Reboot.
My experience: Booted into Recovery, wiped cache, Dalvik cache,
and Factory reset/data
(which I think includes the 2 caches).
The Home key worked in Recovery (other people's symptoms suggest
corrosion in the Home key).
This wiped my bookmarks (and other settings) but didn't cure the
Home key problem.
More drastic: Boot into recovery. Wipe data factory reset. (Also wipes the cache.) Flash CyanogenMod. Flash Google Apps (MDPI). Reboot. Outcome: it did not run the setup wizard. This doesn't seem to be on the phone. The home key is still inoperative.
Got into Koushik's ROM Manager and hit Fix Permissions
.
(And rebooted afterward.) It changed 64 files and dirs always to
mode 755; some had more restrictive permissions before.
Home key is still inoperative.
Comparing JoshuaE's fix and actual phone behavior, the problem is that the setup wizard is not being run, and the software is insufficiently idiotproof against missing values. Another syndrome element is that the market and map apps do not appear in the launcher page. Nonetheless, all of these are present in the Google Apps (MDPI) image (gapps-mdpi-20110501-signed.zip). I had an idea to obtain the APK's and install them separately, but this is obviously bogus.
More on the home key - receive calls syndrome. Doing the right thing
,
i.e. wipe and reflash, was ineffective on repeated trials. I'm going to try
several lines of attack. Of course it's perverse to stick with the G1 when
the current OS version won't fit on it, and it's definitely on the agenda to
get a new phone, but it's also not prudent, and it's a waste of a good learning
experience, to accelerate that step. So, here's what I'm going to try in the
short term.
Dump the dmesg log and see if there's a clue (not likely). No clues found.
Dump the Android error log and see if there's a clue (more likely).
adb logcat > nccn.log
It works like tail -f. In another window check if it seems to have delivered all the messages up to present time, and if so, kill it.
Unfortunately no clue was found. There was no evidence that it tried to run the Setup Wizard.
AnyCut: put a shortcut to it on your screen, and it will launch anything: make phone call, send SMS, run the Setup Wizard . . .
Filename is com.appdroid.anycut.apk . Normally you get it from the Market, but since I haven't run the setup wizard I can't access the Market. Google search for the filename; found it on an extremely ad-supported site that I normally wouldn't install software from. I downloaded it to my laptop and dug around:
(make and change to a subdirectory, for easy cleanup later)
unzip ../com.appdroid.anycut.apk #(it lists the files)
The app icon is a 48x48 px PNG file, a picture of a house with a transparent background. I was not able to figure out how to check integrity of the package. ADB may or may not check it when installing.
To install a package, connect the USB cable and then, on the PC:
adb install com.appdroid.anycut.apk
On the phone, launch the app from the regular launcher (or
long-press the desktop background, pick Shortcuts, and pick AnyCut
from the list). Select New Shortcut / Activity. From the unedited
list of installed packages pick Setup Wizard
. There are
two instances (many programs have multiple subpackages such as
providers or data collections); I chose the first one. It pops a
box to edit the shortcut; don't change anything. Hit Back
to leave AnyCut.
Now you have a shortcut to the Setup Wizard. Expose the keyboard. Make sure you have wireless data connectivity. Hit the shortcut. The wizard starts. The wizard from Froyo is going to ask you your Gmail loginID (not including @gmail.com; they will fill that in for you), and the account password. If you don't have an account, you can create one. The wizard exits after that but syncs your account in the background; look for a statusbar icon of a circle with two arrow-like triangles. Wait for it to disappear. In my case with absolutely nothing in my Gmail account, it took about 10 minutes.
Curse, curse, that intervention was ineffective: home button does nothing; can't receive calls.
Assuming I can't bring it back from those clues, I'll use a hybrid approach:
Wipe, and load an authentic unhacked Froyo image. Now where do I get it?
Very likely this will run the setup wizard. Assuming success:
Back up system data but not apps.
Wipe, load the CyanogenMod image and Google Apps, and restore the backup.
With any luck, CyanogenMod will inherit the provisioning
data from the authentic Froyo.
As of 2011-08-25 by count of CyanogenMod installations (in thousands):
Model | Installs | Comment |
---|---|---|
bravo | 67.8 | Mid level phone by Motorola for AT&T. |
umss_jordan | 20.9 | |
morrison | 26.2 | |
supersonic | 26.1 | |
passion | 22.6 | |
blade | 20.5 | Low-end phone by ZTC |
sholes | 17.5 | The OG (original) Droid |
buzz | 16.9 | |
galaxysmtd | 15.8 | |
encore | 14.9 | |
Other | 109.7 | |
Total | 358.9 | (All official CyanogenMod installs) |
This was for diagnosing the home key syndrome, but it provided a number of useful tidbits:
This dump is definitely for an initial boot after installation; lots of data files do not exist.
Our chassis is called trout
. Alternatives are
goldfish
(the emulator) and sapphire
(the HTC Magic?)
The keyboard is the trout-keypad-v3 whose layout can be found in /system/usr/keylayout/trout-keypad-v3.kl
We're using a virtual screen size of X = 320px, Y = 960px (actual Y = 480px). Quoted dimensions: 45 x 67mm, about 180dpi. 16bit color 5:6:5 (6 bits green).
Touch screen pixel range: X 80-3400, Y 32-5336, pressure 0-255, size 0-15.
We intrinsically have a backup service. There is no saved data and backups are not enabled.
W/ActivityManager( 170): Unable to start service Intent { act=com.google.android.location.NetworkLocationProvider }: not found
It uses sntp north-america.pool.ntp.org
to set the clock,
but cellular data is disabled and so this doesn't work.
No sign that it tried to mount the ext4 filesystem.
It appears to have mounted /dev/block/vold/179:1 on /mnt/sdcard
Our DNS server: 172.18.7.170 (RFC 1918 address)
There is no sign that it tried to start the Setup Wizard.
You need an ext[34] partition. There's a chroot program called "Run Linux", and you can bind mount. Get the picture?
Several that I already picked are on this list, and several on the list look like I will want them.
Link to a writeup about the Android bootscript system.
Unlike SysV init which uses a horrid syntax for /etc/inittab, Android's init has a semi-programmatic syntax for init. One commandoid per line, words are whitespace separated, #comments and empty lines are ignored, double quotes and backslash escapes are recognized.
There are two kinds of sections: actions and services. (Everything has to be in a section.)
An action section has the form: on [trigger] \n [command]...
It is possibly true that there can be only one action per
unique trigger.
A service section has the form: service [name] [fullpath] [args]* \n [option]...
The service name definitely must be unique.
There are several options; the most significant is oneshot
which means to run the service once at boot but not restart it if it
exits, which would be the normal behavior. The disabled
option
suppresses the service on boot; it can be activated by a command.
There are five triggers: boot, name=value, device-added,
device-removed, service-exited. name=value fires when a property is
set using the setprop command,
e.g. setprop cm.userinit.active 1
.
device-added-/dev/block/mmcblk0p2 did not fire for me.
There are a lot of commands, but to execute arbitrary binary
programs you have to define them as one-shot services and use the
start
command. Types of commands:
The CyanogenMod init script has these features, starting with the
on init
section:
Services include:
/system/etc/init.local.rc starts these services:
At some early point, something kicks off the scripts in /system/etc/init.d (probably using runparts):
Shows a banner at the start of the logcat
information; it spells out cyanogenmod
in unreadable ASCII art.
Sets kernel parms from /etc/sysctl.conf, which exists but is empty.
Sets audio parameters, picking the init file according to the hardware model.
If existing, execs then removes /data/firstboot.sh
Loads (modprobe) modules listed in the script, currently just ipv6.
Identifies the first partition of type 83 on the SD card (if any), runs e2fsck, and mounts it on /sd-ext . But it did not find /dev/block/mmcblk0 .
Executes each of these scripts, if existing:
XMPP/Jabber Client -- all of Xabber, Beem and Yaxim fail to connect to the server, and sooner or later force close. The server alleges it accepted a connection, but it (seemingly) never goes beyond the 3-way handshake.
Mount ext4 Partition of SD Card on Boot -- Traced it to needing to mung /system/etc/vold.fstab , which is nontrivial.
Root Certificates in System Keystore -- I installed CACertMan, which can delete a CA cert. Watch for an update allowing insertion. I installed my certs by cowboy programming.
Apps | Hardware | Setup | Network | Hacking | Wishlist | Top |