HowDoiBecomeRoot

OK, first, the disclaimer:

~+Doing whatever is stated on this page is not endorsed by Nokia in any way. If you attempt this, you may brick your device (read: render it unusable) and may have interesting explanation sessions with the Nokia support staff to get the device unbricked (via the unnamed-Nokia-specific-port-next-to-the-battery, no doubt)+~

~+(¡Ahora también en castellano!)+~

Warning: There have been reports of display failures (white with dim vertical stripes) after disabling rd mode and rebooting a new 770. If you get this, there is a hardware failure in your device and you need to return it and get a replacement -- VilleRanki

That failure is probably not related to any software-actions. Displays like the one of the 770 tend to break at powerup. But if yours survived the first 5 or 10 times, it should survive the rest, too. -- BooIiing

Mine got the failure after charging the battery overnight :( It seems that the device is working properly except for the screen, which looks vertically blurred, so I could extract my data from the MMCs via USB prior to before the device to my local dealer, where I got a new one. -- Aswarp 060415

Screenshot added: Cracked screen; Screen bug Post. --Aswarp 060802

I got this on about the 8th powerup of my device. Lucky me, I bought my 770 while in the States, but live in Canada. Nokia US and Canadian customer support were incredibly unhelpful, but I ended up being able to send my 770 to the repair depot in the US, and they shipped it back to my Canadian address (even though US customer support told me they would only be able to return to US addresses). -- Unit3

Note: On at least one computer flasher reboots the computer when flashing under vmware.

The easiest way (install dropbear)

See HowDoiBecomeRoot2 for the easiest way to get root in OS2006. No need for R&D mode or USB cables.

The easy way (Linux or Mac OS X needed)

You can enable the Research & Development mode (R&D or RD mode) on the 770, which enables you to execute sudo gainroot to get a root shell.

NOTE: The currently availiable Nokia flasher version (as of 30 March 2006) assumes that usbfs is mounted on /proc/bus/usb, but usbfs is deprecated and has been dropped on most newer Linuxes. If you find that flasher doesn't recognise that the device is connected and you have a kernel version >= 2.6.15, this is probably the issue.

   <http://maemo.org/maemowiki/Flasher_tool_usage#head-524da1a3404b8b55e32f9c661594607821308c9a>
  • Download the Linux or Mac OS X flasher from http://maemo.org/downloads/d3.php
  • Ensure it's executable: chmod a+x &quot;flasher...&quot;
  • Switch off the Nokia 770
  • Unplug it from a charger
  • Connect it to your computer via USB directly (hubs can prevent the flasher from detecting the device)
  • From your computer: As root, or using sudo, execute ./flasher &lt;del&gt;enable-rd-mode &lt;/del&gt;reboot
  • "Suitable USB device not found, waiting" is displayed on the console
  • Switch on the 770 using the power button while holding down the home button I did not touch the home button and proceeded successfully -- 2005-12-27 --RickHull It worked for me after disabling the device lock -- 05/04/06 Florian I did it without the home button as well and it worked OK for me too. -- 3/26/06 -- Bill B. Well, I just did it for the first time with my one-day-old tablet, and I did have to press the home button. Otherwise, the device booted normally, and no messages came from the flasher utility (from Mac OS X). When pressing home, you get the icon for the "system settings" (a wrench over a tablet) right under the big blue NOKIA logo at boot up. The USB logo appeared in the top-right corner of the screen on both boot-ups, the normal one and the one with the home button. -- AlbertoGonzalezPalomo
  • Whilst it powers on you'll see additional debug information.
  • The flasher program will now tell you something like: USB device found at bus 001, device address 004 Found board Nokia 770 (F5) NOLO version 0.9.0 The device is now in R&D mode I had to pull the USB cable at this point before the unit rebooted. -- 2006-03-29 -- NealMcBurnett Me too -- 2006-04-01 -- N7DR
  • If not already done install an xterm on the 770
  • Open the xterm and execute sudo gainroot You will probably get a scary message pointing you the possibility of breaking your device doing so. Ignore it ¿?
  • Try this if it doesn't work: sudo /usr/sbin/gainroot

That's it. If you get the error, "Error claiming USB interface: Operation not permitted", it means you've forgotten to run the flasher as root. It is possible to encounter other errors (even if invoked as root) that may be caused by timing issues. For more information and a possible solution, go to the following maemo-developers thread.

Once becoming root, in order to easily become root without needing to be in R&D mode, modify the gainroot script (located in /usr/sbin/gainroot) to only invoke the shell (i.e. /bin/sh) or modify /etc/sudoers to make something like su sudo-capable. (IT'D BE NICE IF someone uploaded samples of the original and the modified file to the wiki at this point) Modifying gainroot is likely an easier option for novice users and should be accomplished by commenting out (i.e. prepending lines with a #) the check if R&D mode is enabled. More specifically, after the "PATH=..." line, comment out the following lines except for the /bin/sh line.

BEFORE

#!/bin/sh -e
trap exit SIGHUP SIGINT SIGTERM
PATH=/bin:/user/bin:/sbin:/usr/sbin
MODE='/usr/sbin/chroot /mnt/initfs cal-tool --get-rd-mode
if [ x$MODE = xenabled]
then
     echo "Root shell enabled"
     /bin/sh
else
     echo "Enable RD mode if you want to break your device"
fi

AFTER

#!/bin/sh -e
trap exit SIGHUP SIGINT SIGTERM
PATH=/bin:/user/bin:/sbin:/usr/sbin
#MODE='/usr/sbin/chroot /mnt/initfs cal-tool --get-rd-mode
#if [ x$MODE = xenabled]
#then
#     echo "Root shell enabled"
     /bin/sh
#else
#     echo "Enable RD mode if you want to break your device"
#fi

There are a couple of possibilities for modifying gainroot or /etc/sudoers, both of which require xterm: * The file can be copied to another system (via USB or scp as examples), modified on the system, and copied back. In order to use USB, it will first be necessary to copy the appropriate file to the memory card using something like: cp /usr/sbin/gainroot /media/mmc1 . A similar cp command (cp /media/mmc1/gainroot /usr/sbin) would be used to copy a modified gainroot file back. MMC is disabled while USB cable is connected. I had to power down, disconnect, reboot and become root again to copy the file to the MMC. -- 3/26/06 -- Bill B. I just had to unplug the USB cable when using the MMC locally, and plug it back in to access it from my PC -- NealMcBurnett * An editor can be used on the 770 itself to modify the file, such as vim or joe. Novice users may find joe to be easier to use than vim. I couldn't get VIM or Joe to run -- they installed, but I could not find them. Maybe a newby thing? You can always email the gainroot file to yourself on another PC, edit it, and email it back. -- 3/26/06 -- Bill B. (as with most user-installable utilities, make sure /var/lib/install/usr/bin is in your $PATH -hczim) * How Do I Become Root - without using a text editor (backing up gainroot before modification):
cp -p /usr/sbin/gainroot /usr/sbin/gainroot~ && sed -i '1,/PATH=/!s/^/#/;/sh$/s/#//' /usr/sbin/gainroot * How Do I Become Root - without using a text editor (by enabling sudo for all user commands):
cp -p /etc/sudoers /etc/sudoers~ && echo user ALL = NOPASSWD: ALL >> /etc/sudoers

Once root access has been granted, it is recommended to disable R&D mode. This can be accomplished by following the same instructions as for enabling R&D mode but using ./flasher &lt;del&gt;disable-rd-mode &lt;/del&gt;reboot instead.


Spanish translation / Traducción al castellano (Skip for the rest of the english text, including "The hard way of gaining root")

Translated:Aswarp (Spain) on 12/Abril/2006

Last edited on 02/Agosto/2006

Traduciré sólamente la primera parte del artículo: ~+"EL MÉTODO FÁCIL PARA SER ROOT EN EL NOKIA 770"+~

Si te gusta la traducción, colabora con más texto, desarrollos en castellano, ports de tus aplicaciones favoritas... lo que sea :)

~+NOKIA NO RECOMIENDA EN ABSOLUTO HACER LO QUE SE INDICA EN ESTA PÁGINA. Si lo intentas, tu dispositivo puede quedar convertido en un bonito y caro pisapapeles (quedando totalmente inutilizado) y puede que tengas que mantener una embarazosa conversación con los técnicos de Nokia para lograr que vuelva a su ser (sin duda relacionada con el innombrable-puerto-oculto-específico-de-Nokia-situado-junto-a-la-batería)+~

Aviso: Se han recibido informes de fallos en la pantalla (con franjas finas verticales) tras desactivar el modo R&D y reiniciar un 770 nuevecito. Si te ocurriera es que existe un defecto en el hardware de tu dispositivo y puedes pedir que te lo cambien -- VilleRanki

Este fallo no debería tener nada que ver con el software. Las pantallas que se utilizan en el Nokia 770 se rompen a veces durante los primeros 5 o 10 encendidos. Si el tuyo sobrevive a esto, con toda seguridad sobrevivirá siempre -- BooIiing

La mía falló tras cargar la batería toda la noche :( Parece que el dispositivo sigue funcionado excepto por la pantalla, que se muestra emborronada verticalmente, así que he podido copiar mis datos de las tarjetas MMC vía USB antes de llevarlo al distribuidor. -- Aswarp 060415

Fotografía añadida: Pisapapeles caro; Post en la lista. --Aswarp 060802

Me pasó esto en el 8º encendido. Vaya suerte, compré my 770 en los Estados Unidos pero vivo en Canadá, y Nokia (En Canada y USA) me ha dicho básicamente que no tengo modo alguno de obtener garantía por ello. Ahora tengo un pisapapeles caro de verdad. :P -- Unit3

Nota: En al menor un ordenador, el Flasher reinicia el ordenador cuando se flashea con wmware

El método más sencillo (instalar dropbear)

Ver HowDoiBecomeRoot2 para el método más sencillo de ganar acceso root en OS2006. No hace falta activar el modo I+D ni tampoco cables USB.

El método sencillo (se necesita un ordenador con Linux o Mac OS X)

Tendrás que activar el modo Research & Development (Investigación y Desarrollo, I+D, R&D ó RD mode) en el Nokia 770, que te permitirá ejecutar 'sudo gainroot' para conseguir una shell de root. Esto significa que dejarás de ser un simple usuario de la máquina para convertirte en administrador, lo que te permitirá efectuar cualquier tipo de cambios en el sistema operativo de tu 770, en concreto los reservados al SuperUsuario (su).

NOTA: La versión que está disponible actualmente del flasheador de Nokia (a 30 de Marzo de 2006) asume que usbfs (USB File System o Sistema de Archivos del Bus Serie Universal) está montado en el directorio /proc/bus/usb, pero usbfs está depreciado y se ha dejado de mantener en muchos sistemas Linux modernos. Si te encuentras con que el flasher no reconociera que se ha conectado el dispositivo (Nokia 770 Internet Tablet) y tu ordenador tiene una versión del kernel de Linux posterior a la 2.6.15, seguro que el problema está ahí.

   <http://maemo.org/maemowiki/Flasher_tool_usage#head-524da1a3404b8b55e32f9c661594607821308c9a>
  • Descarga el flasheador para Linux o Mac OS X (dependiendo de cuál sea el Sistema Operativo de tu ordenador. ¿Cuándo habrá uno para Windows?¿¿Es posible/deseable que lo haya??) desde la página http://maemo.org/downloads/d3.php
  • Asegúrate que es ejecutable: chmod a+x &quot;flasher...&quot;
  • Apaga tu Nokia 770
  • Desconecta el cargador si es necesario
  • Conéctalo a tu ordenador por el puerto USB directamente (En ciertos casos, los hubs o 'concentradores de red' pueden evitar que el flasheador reconozca tu dispositivo)
  • Desde tu ordenador: Como usuario root, o empleando el comando sudo, ejecuta lo siguiente: ./flasher &lt;del&gt;enable-rd-mode &lt;/del&gt;reboot
  • Aparecerá un mensaje en la consola: "Suitable USB device not found, waiting" (Esperando la conexión de un dispositivo USB adecuado)
  • Enciende el 770 con el botón de encendido MIENTRAS mantienes apretada la tecla 'Home' No toqué el botón Home y funcionó -- 2005-12-27 --RickHull Me funcionó después de desactivar el bloqueo del dispositivo -- 050406 Florian
    También lo hice sin el botón Home y me funcionó bien. -- 3/26/06 -- Bill B. Bueno, lo hice la primera vez con mi dispositivo un día después de comprarlo y tuve que pulsar el botón Home. De no hacerlo, el dispositivo arrancaba normalmente y no aparecían los mensajes del programa flasheador (desde Mac OS X). Cuando sí se pulsa home, aparece el icono de "configuración del sistema" (una llave sobre un tablet) justo bajo el logo grande de Nokia al arrancar. El logo USB apareció en la esquina superior derecha de la pantalla en ambos arranques, el normal y el del botón Home pulsado. -- AlbertoGonzalezPalomo
  • Mientras arranca, verás información adicional de depuración de errores.
  • El programa flasheador te dirá algo así como: USB device found at bus 001, device address 004 Found board Nokia 770 (F5) NOLO version 0.9.0 The device is now in R&D mode

Que significa:

Se ha encontrado un dispositivo USB conectado al bus 001, la dirección del dispositivo es 004 Se ha encontrado una placa Nokia 770 (F5) NOLO versión 0.9.0 El dispositivo está en modo I+D

_Tuve que quitar el cable USB en este punto antes de que se reiniciara la unidad. -- 2006-03-29 -- NealMcBurnett_
_Yo también -- 2006-04-01 -- N7DR_

* Si aún no lo has hecho, instala xterm en tu 770. Debes tener suficiente espacio libre para ello, por supuesto. * Abre X-term y ejecuta sudo gainroot Probablemente te aparecerá un mensaje advirtiendo de la posibilidad de que te estés cargando el trasto. Ignóralo ¿? * Si lo anterior no funciona, el sistema no encuentra el ejecutable 'gainroot', por lo que debes especificar el directorio donde reside. Prueba con lo siguiente: : sudo /usr/sbin/gainroot

Ya está. Si vieras el mensaje de error "Error claiming USB interface: Operation not permitted" ("Error al reclamar a la interfaz USB: No se permite la oepración"), significa que has olvidado ejecutar el flasheador como root (en tu ordenador). Es posible que aparezcan otros errores (incluso si se ejecuta como root) que pueden deberse a problemas de sincronización. Para más información y posibles soluciones, ve a la siguiente hebra de desarrolladores de maemo.

Una vez que seas root, podrás activar el modo root fácilmente sin tener que estar en modo R&D (I+D) si modificas es script llamado 'gainroot' (situado en /usr/sbin/gainroot) para que invoque sólamentela shell (p.ej. /bin/sh) o bien modificar /etc/sudoers para hacer algo como su sudo-capable. (SERÍA BUENO QUE alguien subiera aquí, al wiki, unas muestras de los archivos antes y después de ser modificados) Modificar gainroot debería ser la alternativa más fácil para usuarios inexpertos y debe hacerse comentarizando (convirtiendo en comentarios, p.ej. precediendo las líneas con el símbolo #) la comprobación que se hace sobre si el modo R&D está activo. Más específicamente, tras la línea "PATH=...", comentarizar las líneas siguientes excepto la línea /bin/sh.

Hay algunas alternativas para modificar gainroot o /etc/sudoers; ambas requieren xterm: * Por seguridad, el archivo gainroot se debería copiar a otro sistema (por USB o scp por ejemplo), modificarlo en el sistema y vuelto a copiar. Para poder usar USB, primero habrá que copiar el archivo correspondiente a la tarjeta de memoria usando algo como: cp /usr/sbin/gainroot /media/mmc1 . Se podría utilizar un comando cp similar (cp /media/mmc1/gainroot /usr/sbin) para copiar el archivo gainroot modificado de vuelta. Como la tarjeta MMC queda desactivada mientras está conectado el cable USB, tuve que apagar, desconectar, reiniciar y conseguir root de nuevo para poder copiar el archivo a la MMAC. -- 3/26/06 -- Bill B. Sólo tuve que desconectar el cable USB mientras utilizaba la MMC localmente, y volver a conectarlo para poder accederla desde mi PC -- NealMcBurnett * Se puede utilizar un editor en el propio 770 para modificar el archivo, tal como vim o bien joe. Los uauarios inexpertos encontrarán que joe es más fácil de usar que vim. No pude lograr que funcionaran VIM ni Joe -- se instalaron, pero no pude encontrarlos. ¿Quizá es cosa de novatos?Maybe a newby thing? Siempre puedes emviarte el archivo gainroot a tí mismo para editarlo desde otro PC, y volver a enviártelo una vez modificado. -- 3/26/06 -- Bill B. (como con la mayoría de utilidades instalables por el usuario, aseúrate de que /var/lib/install/usr/bin está en tu $PATH -hczim) * ¿Cómo conseguir ser Root - sin usar un editor de texto? (haciendo copia de seguridad de gainroot antes de modificarlo):
cp -p /usr/sbin/gainroot /usr/sbin/gainroot~ && sed -i '1,/PATH=/!s/^/#/;/sh$/s/#//' /usr/sbin/gainroot * ¿Cómo conseguir ser Root - sin usar un editor de texto? (activando sudo para todos los comandos del usuario):
cp -p /etc/sudoers /etc/sudoers~ && echo user ALL = NOPASSWD: ALL >> /etc/sudoers

Una vez que hayas conseguido acceso root, se recomienda desactivar el modo R&D (I+D). Esto puede hacerse siguiendo las mismas instrucciones para activar dicho modo, pero usando ./flasher &lt;del&gt;disable-rd-mode &lt;/del&gt;reboot en su lugar.


The hard way (only of academic interest)

The HardWayToBecomeRoot were cleverly worked out by Jochen Eisinger before the Flasher was released. As the Flasher allows enabling R&D mode (and hence sudo gainroot) these instructions are now of historical interest only.

1 ) download the software update from nokia, and unzip it

2 ) run ex (think extract) - http://c0ffee.org/stuff/ex.c

3 ) copy all .dmp files to a subdir (let's say ~/tmp/)

4 ) mount the rootfs.dmp (parameters for mtdram are total_size=55936 erase_size=128)

5 ) modify usr/sbin/gainroot to be a bit less concerned about r&d mode

6 ) umount the image, dump the mtdblock device to ~/tmp/rootfs.dmp

7 ) run cn (think construct) - http://c0ffee.org/stuff/cn.c

8 ) flash the resulting img on your device

9 ) install xterm

10 ) sudo /usr/sbin/gainroot

have fun :)

HardWayToBecomeRoot