User:Asasaki:N800Setup
Contents
Initial setup
Update firmware
http://europe.nokia.com/A4678158
Make sure you're on OS2008 v 4.2008.36-5. You can check in Settings -> Control Panel -> About product.
If you're on OS2008 v 4.2008.23-14, you should be able to update to the latest. However, I haven't done this so I can't vouch for it. Also, if the latest is past 4.2008.36-5, you might be updating to an OS version that the others aren't on yet. Best to just flash 4.2008.36-5.
Otherwise, you'll need to flash the firmware. http://wiki.maemo.org/Updating_the_tablet_firmware#Flashing_on_Mac_OS_X
Firmware images:
N800: http://people.mozilla.com/~asasaki/maemo/n800-RX-34_DIABLO_4.2008.36-5_PR_COMBINED_MR0_ARM.bin
N810: http://people.mozilla.com/~asasaki/maemo/n810-RX-44_DIABLO_4.2008.36-5_PR_COMBINED_MR0_ARM.bin
If you're using 770Flasher.app, open it, and choose the appropriate image. Make sure the device is attached but completely turned off and unplugged. Then I find it easiest to attach the device via USB, then hold down the Home button while plugging it in. Hold the Home button until the flashing is completely done... I think I let go once and it was interrupted. If this happens, just start over.
The Home button is on the front, bottom left on N800's. Top, left on N810's.
Reset device
If you have a device with the correct firmware but is in an unknown state, you can reset the device.
To reset the device (back out system settings, but not user created data), you can Settings -> Control Panel -> (menu) -> Tools -> Restore original settings. You'll have to enter the lock code. The default is 12345. The device will reboot.
To clear user-created data (remove user created data, but leave apps etc. alone), you can Settings -> Control Panel -> (menu) -> Tools -> Clear device. You'll have to enter the lock code. The default is 12345. The device will reboot.
Set up initial user preferences
Device language: English (USA) Date Hostname (n810-talos02)
Cancel phone setup.
Go to Settings -> Control Panel.
Date and time
Select home city to set the timezone (Los Angeles for Mountain View).
Display
Display stays lit: while charging.
Memory
If you have an internal memory card, you will want to go to the Virtual tab and enable virtual memory (128mb).
Connectivity
When you first open the browser, you need to connect to Mozilla Guest. Alternately, you can click on the wifi icon in the top right and Select connection. Save this connection.
Next, disconnect. Then in the Connectivity control panel, click Connections, then select Mozilla Guest, and click Edit. Hit "Next" twice, then find the "Advanced" button and click that. Under the "Other" tab, turn Power saving to "off".
Then reconnect to Mozilla Guest.
Sounds
Turn system sounds off so you don't drive people crazy when these things reboot all the time.
Install software
ssh
From the tablet, open the browser, go to http://maemo.org/downloads/product/OS2008/openssh/ and click the install icon. To minimize typing you can just google for "maemo ssh".
It'll ask you if you want to enable the Extras software repo; say yes. Also, you need to enter the root password at this point.
Also, for future command line usage, note that the default /bin/sh is ash, not bash, so certain things like history or !! will not work properly. vi has a lack of multi-line editing and undo. However, this is still preferable to not having shell access.
homeip
Settings -> Application manager -> Browse installable applications -> Accessories -> homeip -> Install.
Then, close Application Manager. Click the menu icon next to "Home" at the top left. Choose "Select applets" and unselect everything but HomeIP.
Drag the IP anywhere you want on the screen.
moredimmingoptions
I didn't like how the display keeps shutting off on the N810s... it has a different idea of what "charging" is than the N800, so it'll shut off the display even when it's plugged in.
I installed http://maemo.org/downloads/product/OS2008/moredimmingoptions/ and increased the timeouts. I find 60min + 480min work fairly well.
Also see http://maemo.org/community/maemo-developers/can-t_force_display_light_to_stay_on_forever/ if this becomes an issue.
acknowledge update notification icon
Strangely enough, the little blinky orange notification icon causes noticeable drag on certain performance tests. You can disable it by clicking on it and choosing to "Install...". However, instead of installing the updates, close out of Application Manager once it loads.
Afterwards, to disable auto-update checking,
mv /etc/cron.daily/apt /root/apt.cron
nginx
Open the browser, go to http://maemo.org/downloads/product/OS2007/nginx/ and click the install icon.
Apache is also available, but it comes with a significantly larger footprint.
Once nginx is installed, edit /etc/nginx/nginx.conf and change the default_type to text/plain to fix bug 432765.
fix apt-get
Now ssh into the box as root.
echo "deb http://p.quinput.eu/debfarm chinook user" >> /etc/apt/sources.list apt-get update apt-get -f install
Note, if you get "Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?", then you probably need to close Application Manager.
file transfer utilities
apt-get install rsync wget bzip2 gnutar
x11vnc
apt-get install x11vnc
Then
# Yes, the username is actually "user" su user x11vnc -storepasswd # Enter your desired vnc password; save to /home/user/.vnc/passwd exit
After installing vnc server and adding the user vnc password, it's desirable to have vnc start up automatically. I hacked the following /etc/init.d/x11vnc from /usr/bin/x11vnc.sh and /etc/init.d/ssh:
#!/bin/sh # built from /usr/bin/x11vnc.sh and /etc/init.d/ssh # test -x /usr/bin/x11vnc || exit 0 export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" case "$1" in start) echo -n "Starting VNC server: x11vnc" start-stop-daemon --start --quiet --pidfile /var/run/x11vnc.pid -b -c user --exec /usr/bin/x11vnc -- -cursor arrow -usepw > /var/log/x11vnc.log 2>&1 echo "." ;; stop) echo -n "Stopping VNC server: x11vnc" start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/x11vnc.pid echo "." ;; restart) echo -n "Restarting VNC server: x11vnc" start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/x11vnc.pid start-stop-daemon --start --quiet --pidfile /var/run/x11vnc.pid -b -c user --exec /usr/bin/x11vnc -- -cursor arrow -usepw > /var/log/x11vnc.log 2>&1 echo "." ;; *) echo "Usage: /etc/init.d/x11vnc {start|stop|restart}" exit 1 esac exit 0
Then make it executable, add it to startup, and start it up:
chmod a+x /etc/init.d/x11vnc update-rc.d x11vnc defaults 99 /etc/init.d/x11vnc start
Misc setup
Set hostname
Edit /etc/hostname.
hostname `cat /etc/hostname`
Clean up disk, part 1
On the N810s you're going to have an internal memory card (with swap) on /media/mmc2. There are Video and map subdirectories; nuke those.
Also nuke the MyDocs/ dir in /home/user.
Set up buildbot slave
Install twisted
First, append this to /root/.bashrc :
export PYTHONPATH="/media/mmc1/twisted/twisted-2.4.0/lib/python2.5/site-packages:/media/mmc1/twisted/twisted-core-2.4.0/lib/python2.5/site-packages:/media/mmc1/twisted/zope-interface-3.3.0/lib/python2.5/site-packages"
and get that in your local env:
. /root/.bashrc
Quick 'n' dirty
Copy /media/mmc1/twisted from another box. If possible,
ln -s /media/mmc1/twisted /tools
But the softlink may not work, and the softlinks inside twisted/ might be borked, which is why the PYTHONPATH above points to the actual directories in twisted/.
Full on ugly
If you can't do this, you need to cross-compile twisted on a linux box with scratchbox. Why? Basically because the python setup.py install requires more development tools than we want to put on these devices, even if they're all available.
The following instructions may be incomplete since I've only done it once, a few weeks ago, and it involved a lot of trial and error, so I'm not entirely sure which steps are necessary.
/scratchbox/moz_scratchbox sb-conf select CHINOOK_X86
Edit /etc/apt/sources.list so it looks like:
deb http://repository.maemo.org/ chinook free non-free deb-src http://repository.maemo.org/ chinook free deb http://repository.maemo.org/extras/ bora free ##maemo:name Nokia Catalogue ##maemo:essential #deb http://catalogue.tableteer.nokia.com/certified/ bora user ##maemo:name Nokia Catalogue (3rd party software) #deb http://catalogue.tableteer.nokia.com/non-certified/ bora user ##maemo:name Maemo 3.0 'bora' #deb http://repository.maemo.org/ bora free non-free extras ##maemo:name xmoto #deb http://download.tuxfamily.org/xmoto/maemo/ it2007 testing ##maemo:name maemo-hackers #deb http://maemo-hackers.org/apt mistral main ##maemo:name Skyhusker's Catalogue #deb http://zeus.rm-fr.net/~skyhusker/maemo bora free ##maemo:name bora-extras #deb http://repository.maemo.org/extras bora free non-free ##maemo:name INdT Games #deb http://marceloeduardo.com/apt mistral games ##maemo:name Minimo #deb http://home.ufam.edu.br/~agan/minimo bora user ##maemo:name mg #deb http://mg.pov.lt/770 bora user other ##maemo:name maemo-hackers #deb http://maemo-hackers.org/apt bora main ##maemo:name maemo.org.br #deb http://www.maemo.org.br/platform/apt/ mistral user ##maemo:name Canola #deb http://openbossa.indt.org.br/canola/...ory-beta2/bora bora user ##maemo:name Maemo extras #deb http://repository.maemo.org/extras/ bora free non-free ##maemo:name Kernel Concepts #deb http://downloads.kernelconcepts.de/maemo3 bora free ##maemo:name MUlliNER.ORG Maemo Software (Maemo 3.x) #deb http://www.mulliner.org/nokia770/repository/ bora free ##maemo:name Nokia Research Cambridge #deb http://repository.nrcc.noklab.com/ bora extras
One of those repositories below line 2 contains the magic python libraries you need to build twisted. Maybe uncomment them out and deal with the warning messages?
At this point you can
apt-get update apt-get install python2.5*
The list of python debs you need includes python2.5-xml*
Once you do this successfully you'll be able to do the below without failing. You'll know if you didn't do this successfully if you aren't able to do the below without failing. Either that or I've documented poorly.
Install zope-interface like https://wiki.mozilla.org/ReferencePlatforms/Linux-CentOS-5.0#Installing_Zope_Interface , but
wget http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz tar xfvz zope.interface-3.3.0.tar.gz cd zope.interface-3.3.0 python2.5 setup.py install --prefix=/tools/zope-interface-3.3.0 pushd /tools ln -s zope-interface-3.3.0 zope-interface export PYTHONPATH="/tools/zope-interface/lib/python2.5/site-packages:$PYTHONPATH" popd
Install twisted-core:
cd .. wget http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/TwistedCore-2.4.0.tar.bz2 wget http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/Twisted-2.4.0.tar.bz2 tar xfvj TwistedCore-2.4.0.tar.bz2 tar xfvj Twisted-2.4.0.tar.bz2 cd TwistedCore-2.4.0 python2.5 setup.py install --prefix=/tools/twisted-core-2.4.0 pushd /tools ln -s twisted-core-2.4.0 twisted-core export PYTHONPATH="/tools/twisted-core/lib/python2.5/site-packages:$PYTHONPATH" popd cd Twisted-2.4.0 python2.5 setup.py install --prefix=/tools/twisted-2.4.0 pushd /tools ln -s twisted-2.4.0 twisted export PYTHONPATH="/tools/twisted/lib/python2.5/site-packages/:$PYTHONPATH" popd
At this point you can copy /tools over to the Nokia as /media/mmc1/twisted, and
ln -s /media/mmc1/twisted /tools
though that's not necessary with the above PYTHONPATH.
... Looking at my .bash_history it appears that I did all of the above in CHINOOK_X86, even though you'd think you'd want to do the python2.5 setup.py install steps in CHINOOK_ARMEL.
It works?
Install buildbot
First, copy over the buildbot source from another computer with CVS.
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d buildbot-079 mozilla/tools/buildbot scp -r buildbot-079 root@DEVICEIP:/media/mmc1/
Then, on the device, you need python2.5-dev:
apt-get install python2.5-dev
Then you're ready to install buildbot:
python setup.py install
Then nuke /media/mmc1/buildbot-079 if you don't have huge amounts of disk.
Set up the slave. For instance, I would
mkdir /media/mmc1/buildbot cd /media/mmc1/buildbot buildbot create-slave --umask=002 . 10.250.3.135:9989 n810-talos02 password
Then edit the buildbot.tac to verify, put your email in info/admin, and the hostname in info/host.
After installing buildbot, you may want to edit /usr/lib/python2.5/site-packages/buildbot/scripts/logwatcher.py, which uses a tail -F on the logfile... the Nokias don't support tail -F . Change this to tail -f
Now you can create an /etc/init.d/buildbot:
#!/bin/sh # built from /usr/bin/x11vnc.sh and /etc/init.d/ssh # test -x /usr/bin/buildbot || exit 0 case "$1" in start) echo -n "Starting buildbot in 120 seconds" /media/mmc1/buildbot/start.sh 120 | tee /media/mmc1/buildbot/start.out & ;; stop) echo -n "Stopping buildbot" cd /media/mmc1/buildbot buildbot stop . echo "." ;; restart) echo -n "Restarting buildbot" cd /media/mmc1/buildbot buildbot stop . buildbot start `pwd` echo "." ;; *) echo "Usage: /etc/init.d/buildbot {start|stop|restart}" exit 1 esac exit 0
Then
chmod a+x /etc/init.d/buildbot update-rc.d buildbot defaults 99
/media/mmc1/buildbot/start.sh looks like this:
#!/bin/sh -x date # Don't continue if buildbot is already running if [ -f "/media/mmc1/buildbot/twistd.pid" ] ; then pid=`cat /media/mmc1/buildbot/twistd.pid` ps -ef | grep $pid | grep -q buildbot if [ $? -eq 0 ] ; then exit 0 fi fi if [ $# -gt 0 ] ; then sleep $1 fi export DISPLAY=:0.0 . /root/.bashrc # set PYTHONPATH # Tweak env settings to be able to run fennec unset CONSOLE export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/session_bus_socket export GTK2_RC_FILES=/home/user/.osso/current-gtk-theme:/home/user/.osso/current-gtk-key-theme export HOME=/root export TMPDIR=/var/tmp export USER=root env rm -f /var/log/nginx/access.log rm -f /var/log/nginx/error.log cd /media/mmc1/buildbot rm -f twistd.log* touch twistd.log buildbot start `pwd`
The trick, for me, was sourcing the .bashrc so the PYTHONPATH is correctly set before trying to launch buildbot.
The reasoning behind this script, with the sleep 120, is that the Nokias don't auto-connect to wifi for about a minute after booting. Also, at and cron appear to be unavailable. This workaround appears to kick off buildbot nicely after boot; I can play with different sleep times if this becomes an issue later.
ssh keys
Fennec
For an initial test, you can grab the latest linux-arm tar.bz2 build from http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mobile-browser-linux-arm/
cd /media/mmc1 wget http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mobile-browser-linux-arm/fennec-1.0a2pre.en-US.linux-arm.tar.bz2 tar xjvf fennec-1.0a2pre.en-US.linux-arm.tar.bz2 cd fennec ./fennec
You should see Fennec show up on the screen.
Talos setup
Install PyYAML
cd /media/mmc1 #wget http://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz wget http://people.mozilla.com/~asasaki/maemo/PyYAML-3.05.tar.gz tar zxvf PyYAML-3.05.tar.gz cd PyYAML-3.05 python setup.py install cd .. rm -rf PyYAML*
Install Talos
Copy talos from another machine with CVS installed:
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d talos mozilla/testing/performance/talos scp -r talos root@DEVICEIP:/media/mmc1/
Then softlink page_load_test in /var/www:
cd /var/www ln -s /media/mmc1/talos/page_load_test .
And test by hitting http://DEVICEIP/page_load_test/manifest.txt in your browser.
Then you need to grab the pageset from an existing talos machine, probably in ~mozqa/pages. Copy this to DEVICEIP:/media/mmc2/pages and softlink that to /media/mmc1/talos/page_load_test/pages
Run generate-tpcomponent.py
Again, on another machine with CVS installed:
cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d perfmasterscripts mozilla/tools/buildbot-configs/testing/talos/perfmaster/scripts cd perfmasterscripts python generate-tpcomponent.py scp chrome components root@DEVICEIP:/media/mmc1/fennec/
Once we start grabbing new builds we'll need a place to grab the chrome/ and components/ files from.
run_tests.sh
You need to create a /media/mmc1/talos/run_tests.sh until Aki gets his master.cfg fixed:
#!/bin/sh -x export DISPLAY=:0.0 LOGFILE="/media/mmc2/test.out" free yml=`ls -1t *.yml | head -1` cat $yml python run_tests.py --noisy --debug $yml 2>&1 | tee $LOGFILE if [ $? -ne 0 ] ; then exit $? else grep -q "FAIL" $LOGFILE if [ $? -eq 0 ] ; then exit 1 fi fi
edit sample.config
Edit sample.config to only have 1 pass of every test, and change firefox to fennec. Also browser_wait to 60.
Unittests
You can probably stop reading here.
Deprecated
swap
If you have an internal memory card, you can add 128MB swap via the Memory control panel, Virtual tab. Easy peasy. However, for additional swap, or if you only have an external card, you can also follow the more arcane steps outlined here:
dd if=/dev/zero of=/media/mmc2/.swap2 bs=1024 count=131072 mkswap /media/mmc2/.swap2
To use the swapfile,
swapon /media/mmc2/.swap2
and use the free command to see the added virtual memory. Turn off swap before ejecting the card:
swapoff /media/mmc2/.swap2
However, I wanted to use these at boot, so instead I added these to /etc/fstab:
/media/mmc2/.swap2 none swap sw 0 0
And added a swapon -a to the #rc.local script.
To make sure you can umount /media/mmc1 on reboot or shutdown, do the following:
sed -i '/umount/iswapoff -a 2>/dev/null' /etc/init.d/minireboot /etc/init.d/minishutdown
Media card
You really don't have enough disk on / to do much, so you need to make the memory card usable. By default it's formatted VFAT, which a) horks your permissions much like running cygwin on top of win32 (e.g. either all files are executable or all files are non-executable).
I'm going to try formatting ext2 so I can use softlinks and real unix permissions. ext3 might be costly with its journaling.
By default, the card is mounted so no file is executable. To fix this permanently, edit /usr/sbin/mmc-mount to remove the noexec, dmask, and fmask. So for VFAT:
#!/bin/sh #mount -t vfat -o rw,noauto,nodev,noexec,nosuid,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133 "$1" "$2" > /dev/null mount -t vfat -o rw,noauto,nodev,nosuid,utf8,uid=29999,shortname=mixed "$1" "$2" > /dev/null
I think you just need to remove the fmask at the bare minimum, but this works.
Disabling rc scripts
To try to get a bit more performance out of the n8x0s, kill some of the unneeded daemons. You can either manually
/etc/init.d/multimediad stop /etc/init.d/mediaplayer-daemon stop /etc/init.d/tablet-browser-daemon stop
or add those lines to /etc/init.d/rc.local (see below), or just remove the links in /etc/rc*.d for those services. The latter will save you the most memory/swap.
Adding new rc scripts
- Create the script in /etc/init.d
- Then add it to the various run level dirs:
Nokia-N800-23-14:~# update-rc.d x11vnc defaults 99 Adding system startup for /etc/init.d/x11vnc ... /etc/rc0.d/K99x11vnc -> ../init.d/x11vnc /etc/rc1.d/K99x11vnc -> ../init.d/x11vnc /etc/rc2.d/S99x11vnc -> ../init.d/x11vnc /etc/rc3.d/S99x11vnc -> ../init.d/x11vnc /etc/rc4.d/S99x11vnc -> ../init.d/x11vnc /etc/rc5.d/S99x11vnc -> ../init.d/x11vnc /etc/rc6.d/K99x11vnc -> ../init.d/x11vnc Nokia-N800-23-14:~#
rc.local
So far this is only for swap and buildbot. After creating swapspace and putting it in /etc/fstab, I created a simple /etc/init.d/rc.local:
#!/bin/sh swapon -a /media/mmc1/buildbot/start.sh 120 | tee /media/mmc1/buildbot/start.out &
Then I added it as above. Note, the default NN (25, I think?) doesn't work; use 99.
update-rc.d rc.local defaults 99
/media/mmc1/buildbot/start.sh looks like this:
#!/bin/sh -x date if [ $# -gt 0 ] ; then sleep $1 fi export DISPLAY=:0.0 . /root/.bashrc # set PYTHONPATH # Tweak env settings to be able to run fennec unset CONSOLE export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/session_bus_socket export GTK2_RC_FILES=/home/user/.osso/current-gtk-theme:/home/user/.osso/current-gtk-key-theme export HOME=/root export TMPDIR=/var/tmp export USER=root env cd /media/mmc1/buildbot buildbot start `pwd`
The trick, for me, was sourcing the .bashrc so the PYTHONPATH is correctly set before trying to launch buildbot.
The reasoning behind this script, with the sleep 120, is that the Nokias don't auto-connect to wifi for about a minute after booting. Also, at and cron appear to be unavailable. This workaround appears to kick off buildbot nicely after boot; I can play with different sleep times if this becomes an issue later.
buildbot
- Precompile twistd on a linux build box (scratchbox). This requires adding some python packages via apt-get. (aki: more documentation needed)
- A make install for twistd still won't work on the Nokia, but you can copy over the final binaries resulting from a make install. I copy these over to /media/mmc1/twisted/ and softlink /tools to /media/mmc1.
- Now you can grab the standard buildbot source from CVS and python setup.py install like normal.
- After installing buildbot, you may want to edit /usr/lib/python2.5/site-packages/buildbot/scripts/logwatcher.py, which uses a tail -F on the logfile... the Nokias don't support tail -F. Change this to tail -f
Unit tests
Saving just in case, but not needed anymore.
WIFI networking
To disable PSM, go to Settings -> Control panel -> Connectivity, Advanced Settings -> Other tab, and turn Power Saving Mode OFF.
TODO: static IP?
USB networking
Currently going wifi only due to regular loss of connectivity through USB ethernet.
However, for posterity, dougt says in bug 463657:
regarding wired connections, for the n800/n810, i bought some OTG connectors which allow you to plug a standard USB Ethernet adaptor into the side of the device. In order to set this up, you need to follow: http://www.internettablettalk.com/wiki/index.php?title=HOWTO:_USB_Host_mode_on_the_N800_using_OS_2008 Or you can just ask me to do it. Also, see some of the tips here: https://wiki.mozilla.org/Mobile/Build/Maemo_Running_Talos
nginx
Edit /etc/nginx/nginx.conf to change the default mime type to text/plain instead of application/octet-stream to fix bug 432765:
# text/html works too default_type text/plain;
VNC
I used the following links to install vnc server:
So I ran into some issues doing this. First, you do have to softlink two libraries:
ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.0.9.7 ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.0.9.7
Then the .deb won't install since it's missing dependencies.
dpkg --force-depends -i x11vnc_0.9.3-1_armel.deb
Then the manual startup isn't great for large test farms, so set up the rc script: User:Asasaki:N800Setup#x11vnc
format media card ext2
WARNING this forced me to re-flash my device!
You have one or two media cards, and they're VFAT. This is causing a lot of headache in setting things up properly for testing. Let's format 'em ext2.
apt-get install e2fsprogs
This installs ext2 as a filesystem. If you can't find e2fsprogs, you probably didn't update the /etc/apt/sources.list above.
Make a note of the /dev/mmcblk* device name of the card you want to format in /etc/fstab.
umount /media/mmc2
If you have problems umounting /media/mmc2, you are probably cd'ed into that dir, or you have swap enabled. Turn that off and try again.
Now you're about to format the filesystem: make sure you don't have anything you want to keep there!
So if the partition that was mounted on /media/mmc2 was /dev/mmcblk0p1, then
/sbin/mkfs.ext2 /dev/mmcblk0p1
Next, edit /etc/fstab to change the entry for that mount:
/dev/mmcblk0p1 /media/mmc2 ext2 rw 0 0
Then edit the mount command in /usr/sbin/mmc-mount:
mount -t auto "$1" "$2" > /dev/null
Finally, mount the card:
mount /media/mmc2
Which should exit without errors. A df -h should show it mounted, and a ls /media/mmc2 should show a lost+found.
Now if you turned off swap to do this, go ahead and turn it back on ( #Memory)