¿Como utiliza Openzaurus la RAM y la Flash en la Zaurus?

La Zaurus tiene 16MB de rom flash, y 64 o 32MB de RAM.

En la ROM de Sharp, los 16MB de flash son de sólo lectura, y todos los paquetes instalados lo hacen en el disco ram (32MB en la 5500, y 6MB en la 5000).

En OpenZaurus, la flash es escribible, por lo que se pueden instalar en ella aplicaciones (de hecho, el destino de instalación por defecto es la flash).

Los diferentes ficheros zImages permiten escoger cuanta memoria RAM se tiene y cuanta se deja como ramdisk para documentos e instalar aplicaciones.

Como explicación:


¿Como liberar 9.7 MB de memoria y pasar programas a la tarjeta SD?

Hacer un flash con OpenZaurus escogiendo el fichero de imagen correspondiente a 64MB de memoria ram y 0MB de disco ram.

Desmontar la tarjeta SD:
umount /mnt/card

Crear dos particiones en la tarjeta SD utilizando fdisk
Necesitarás instalar primero esta utilidad, ya que OpenZaurus no la trae por defecto
Yo tengo una SD de 256MB y por el momento he creado una partición del cilindro 1 al 486 y otra del 487 al 973.

Formatear las dos particiones creadas:
mkfs.ext2 /dev/mmcda1
mkfs.ext2 /dev/mmcda2

Cambiar de nombre los directorios /opt y /usr:
mv /opt /opt2
mv /usr /usr2

Editar el fichero /etc/fstab:
/dev/mmcda1 /opt auto defaults,noauto,noatime,user,exec,suid 0 0 /dev/mmcda2 /usr auto defaults,noauto,noatime,user,exec,suid 0 0

Montar las dos nuevas particiones:
mount -t ext2 /dev/mmcda1 /opt
mount -t ext2 /dev/mmcda2 /usr

Mover el contenido de los antiguos directorios /opt y /usr a las nuevas particiones:
mv /opt2/* /opt
mv /usr2/* /usr
rmdir /opt2
rmdir /usr2

Opcionalmente también se puede mover el directorio /root a la tarjeta SD, por ejemplo:
mv /root /usr
ln -sf /usr/root /root

Como es lo mismo instalar aplicaciones en root que en SD y no existe ram se pueden anular en /etc/ipkg.conf precediendo del carácter '#' esas líneas.

Si se reinicia la pda en este momento... no arrancará opie. Si ya lo has hecho no pasa nada, puedes continuar.
El problema radica en que las particiones de la SD no se montan antes de que lo necesite el sistema.
En /etc/rcS.d se encuentra 'la secuencia de arranque':
cd /etc/rcS.d

Necesitamos espacio para un par de cosas antes de que se ejecute el archivo S01devices, por lo que lo renombraremos as S04devices: mv S01devices S04devices

ln -s ../init.d/sd ./S02sd

Hay que crear un fichero script que contenga un par de líneas para montar las particiones de la SD:
vi ../init.d/sdmnt
y añade las siguientes líneas:
/bin/mount -t ext2 -o defaults,noatime,exec /dev/mmcda1 /opt
/bin/mount -t ext2 -o defaults,noatime,exec /dev/mmcda2 /usr
Y no te olvides de hacerlo ejecutable:
chmod +x ../init.d/sdmnt

ln -s ../init.d/sdmnt ./S03sdmnt


¿Como ejecutar la Zaurus completamente desde la tarjeta SD?

The Zaurus can be booted entirely off external memory by doing the following steps. Here we are assuming that you want to boot off of the sd card but this will work for any external memory or even the internal RAM (a shell script is provided at the end):

The following assumptions are made:
/mnt/card = sd card

  1. copy the /dev/mmcda1 file to a different location
  2. create a script that mounts the sd card (using your new mmcda1 file), and then uses pivot_root to change the root to /mnt/card and remounts the old root someplace else.
  3. link the /etc/init.d/sd script into the /etc/rcS.d folder so that it loads immediately after the 01banner script.
  4. link your script that pivots the root into the /etc/rcS.d folder so that it loads immediately after the sd script.
  5. copy (using cp -a) the /bin, /boot, /etc, /home, /lib, /opt, /root, /sbin, /tmp, and /usr folders to the sd card
  6. create the dev, mnt, mnt/ram, mnt/cf, mnt/root, mnt/net, proc, and var folders on the sd card.
  7. copy the following files from the /dev folder to the dev folder on the sd card: (for now just copy the entire /dev folder)

The advantages to this way are that the original filesystem is modified only very slightly, and if you have a problem with the SD card you can pop it out and reboot, and the original filesystem will then load.

If you want to boot off of the RAM or the cf card you can skip steps 1 and 3.

You can execute the following script to do all this (don't forget chmod -x. I always do. :-):

#!/bin/sh

#
# Script to setup a Zaurus system to boot from the sd card (/mnt/card).
#
# I don't really know very much about shell scripting so this script is not
# very robust.  If someone wants to contribute a better one it would be
# great.

# copy the /dev/mmcda1 to /etc
/bin/cp /dev/mmcda1 /etc

#create our proot script to pivot the root

cd /etc/init.d

echo "#!/bin/sh" > proot
echo " " >> proot
echo "#Script to pivot the root to /mnt/card" >> proot
echo " " >> proot
echo "/bin/mount -t ext2 -o defaults,noatime /etc/mmcda1 /mnt/card" >> proot
echo "/sbin/pivot_root /mnt/card /mnt/card/mnt/root" >> proot

# make script executable
chmod +x proot

# setup our boot sequence
cd /etc/rcS.d
mv S01devices S04devices
ln -s ../init.d/sd ./S02sd
ln -s ../init.d/proot ./S03proot

# copy the files
cp -a /bin /mnt/card/
cp -a /boot /mnt/card/
cp -a /etc /mnt/card/
cp -a /home /mnt/card/
cp -a /lib /mnt/card/
cp -a /opt /mnt/card/
cp -a /root /mnt/card/
cp -a /sbin /mnt/card/
cp -a /tmp /mnt/card/
cp -a /usr /mnt/card/

#fixme
cp -a /dev /mnt/card/

# make the folders that we don't copy
mkdir /mnt/card/var
mkdir /mnt/card/proc
mkdir /mnt/card/mnt
mkdir /mnt/card/mnt/root
mkdir /mnt/card/mnt/cf
mkdir /mnt/card/mnt/net

¿Cómo configurar OpenZaurus para instalar todo el software en la tarjeta SD?

NOTE: Formatear la tarjeta SD: # umount /mnt/card # mkfs.ext2 /dev/mmcda1 # mount /mnt/card
Editar el archivo /etc/fstab y cambiar las opciones de montaje del nuevo sistema de ficheros ext2 para que incluya "noatime", o cambie "sync" por "async", para obtener un rendimiento mejor. (If you have no idea what this means, check the options for the mount command Deshabilitar Documentos: Launcher Al reiniciar la PDA pulsar cualquier tecla para que no se inicie opie. Ejecutar /mnt/cf/confSD2.sh
Editar el archivo /etc/profile y modificar la línea del PATH para que quede como sigue:
PATH="/usr/local/bin:/usr/bin:/bin"
igualmente modificar la variable (el orden de /lib:/usr/lib es importante): LD_LIBRARY_PATH="/opt/QtPalmtop/lib:/usr/local/lib:/lib:/usr/lib"
Editar el archivo /etc/ipkg.conf y añadir un # delante de las líneas: # Because of the way that OpenZaurus is set up, it is NOT necessary to do the following to install applications to your SD card. In OpenZaurus, you can directly install all applications to one of 4 locations: the root partition (the flash mounted on /), the storage ram (amount decided by zImage - mounted on /mnt/ram), a CF card (/mnt/cf), or an SD card (/mnt/card). When installing applications, you can use ipkg -d sd install <packagename> or select SD when installing from the gui package manager to install your application onto the SD card. Then, just run ipkg-link add <packagename> to create symlinks of all the files installed onto the SD onto the root partition so that the applications think they were installed onto the root (ipkg-link is not needed if you're using the GUI).

If you still wish to move directories onto the SD card to cut down on the number of writes to the internal flash, you can follow these instructions:

  1. Firstly, install (flash, see the install guide) the zImage64-0 image on your Zaurus. This will set all 64mb of RAM to be used as operating memory and not storage.
  2. When this is done, and you have the system working, insert your SD/MMC card, and copy the following directories to the card (e.g. cp -a /opt /mnt/card/opt):
  3. Shutdown Opie (or it's likely to crash anyway), then from the command prompt, remove the following directories:
  4. Create symbolic links from / to each of the following directories SD/MMC card (e.g. ln -sf /mnt/card/opt /opt):
  5. Restart OPIE (e.g. /etc/init.d/opie start)

If all went well, you should now have about 8mb (from a default OpenZaurus flash) of space on your ROM (useful for libraries/perl/python/ruby which install to /usr (Note: I'm reliably informed by DaJoker than moving /usr is a bad bad bad idea, though if you must (or if you're very low on space on the ROM) you could move the /usr/local and /usr/share subtrees).

If you now install software to "root" (/) then it should work out nicely, and be installed to the SD card. To prevent confusion, you could remove the lines:

from your /etc/ipkg.conf file, as you have no RAM available for software installation, and installing to root will install to your SD card where possible, so the seperate option is largely redundant.


Mis notas personales al instalar paquetes

Recomiendo deshabilitar 'Documents': si tienes una SD de 256MB y una CF de 512MB te puede dar la risa tenerlo habilitado... al intentar abrir un archivo con determinados programas ¡te escanea todo!

Pediría a todos los programadores que implementen los menús de Nuevo, Abrir y Guardar como toda la vida.
Yo no siempre quiero guardar todos mis archivos en Documents.

Dejemos libertad a los usuarios para decidir como organizar sus datos en el árbol de directorios; al final es lo mismo que Linux, libertad para todo ;-).

Paquetes que no recomiendo instalar

Image Viewer
MooView
Tx Image Viewer

Paquetes que si recomiendo instalar

Eye of Zilla

¿Por qué se obtienen montones de errores al crear enlaces instalando paquetes en otros sitios diferentes de root?

In brief:
The failed to link errors are pretty much harmless and can be ignored because they mean that links are trying to be created to files or directories that already exist (e.g /opt)

More detail:
Opie & Qtopia are set up to run applications and read their settings from directories off the root path (/). When you install an application to root the binary tends to end up (usually) in /opt/QtPalmtop/bin which is where all the paths are set up to read from.

However when you install to you CF card for example (/mnt/cf), the binary will go to /mnt/cf/opt/QtPalmtop/bin which isn't in your path.

To get around this, symbolic links are created that point to the correct locations.

Now when a package is installed, a list is created for that package which contains every file and directory that is involved. An attempt to create a link for each file/directory in the file. If that file/directory already exists (and /opt or /opt/QtPalmtop always exist) you get a failed to link error.


Tras actualizar OZ, ¿cómo se pueden reutilizar las aplicaciones instaladas en SD/MMC/CF?

Cuando se actualiza OZ, todos los contenidos de la memoria interna se pierden; pero las aplicaciones instaladas en CF o SD/MMC aún están ahí. Para hacerlas reaparecer en el GUI de Qtopia, abre un terminal y escribe:

ipkg-link mount /mnt/card

ipkg-link mount /mnt/cf

para SD y CF, respectivamente.


¿Cómo hacer un backup?


¿Qué es un md5 hash? ¿Cómo se obtiene?

Un md5 hash es una cadena de 32 carateres alfanumérica (números hexadecimales).

Un fichero solamente tiene un md5 hash, si se cambia un sólo byte en un fichero el cálculo para obtener el número md5 producirá un valor totalmente diferente. Por esto el cálculo de este número es útil para comprobar la integridad de los ficheros descargados.

En Linux (incluida la Zaurus), el programa md5sum puede ser usado para obtener el md5 hash. Simplemente teclea md5sum [fichero]


¿Cómo se puede ver el contenido de un fichero .ipk?

En Linux, intenta uasr ar -x fichero.ipk para obtener un tarball el cual puedes extraer con tar.

splashscreen

Puedes crear tu propia pantalla cogiendo cualquier archivo de gráficos bmp de 32 bit 320x240 y copiándolo a /opt/QtPalmtop/pics/Startup_screen.bmp .

GNU C Compiler for the Zaurus

I followed the instructions for settting up the gcc compiler on the Zaurus
The necessary files were hosted on sourcforge, but i do not know where they are now. You may check here from time to time
The readme in html format for setting up the compiler can be found here
Then i added the gnu debugger for arm, the gdb help files
I then took the whole gcc files and put it into a cramfs which can de found here (8.1 MB)
Copy this file to your SD or CF card and mount it somwhere (i call it /gccmountpoint here):

# mount -t cramfs -o loop gcc.cramfs /gccmountpoint

Afterwards you have to include /gccmountpoint/bin into your path. The files to set your path are /home/QtPalmtop/qpe.sh for within Qtopia and /home/root/.profile for SSH/Telnet shells

You have also to create the correct links (download script here):

#/bin/bash
GCCMOUNT=/gccmountpoint
#links for gcc
ln -sf $GCCMOUNT/include /usr/local/include
ln -sf $GCCMOUNT/lib/Mcrt1.o /usr/lib/Mcrt1.o
ln -sf $GCCMOUNT/lib/crt1.o /usr/lib/crt1.o
ln -sf $GCCMOUNT/lib/crti.o /usr/lib/crti.o
ln -sf $GCCMOUNT/lib/crtn.o /usr/lib/crtn.o
ln -sf $GCCMOUNT/lib/gcc-lib /usr/lib/gcc-lib
ln -sf $GCCMOUNT/lib/libbfd-2.9.5.0.14.so /usr/lib/libbfd-2.9.5.0.14.so
ln -sf $GCCMOUNT/lib/libopcodes-2.9.5.0.14.so /usr/lib/libopcodes-2.9.5.0.14.so
ln -sf $GCCMOUNT/lib/libstdc++-3-libc6.1-2-2.10.0.so /usr/lib/libstdc++-libc6.1-2.so.3
ln -sf /usr/lib/libstdc++-libc6.1-2.so.3 /usr/lib/libstdc++.so
ln -sf /lib/libc.so.6 /usr/lib/libc.so
ln -sf /lib/libm.so.6 /usr/lib/libm.so


uninstall

before you remove any of the cram files you have to make absolutly sure that they are umounted !
If you do not umount the cram file and remove it, the file will not really be deleted. You will not find it in the directory tree, but it will still be in your filesystem. The only way to get rid of this semi-deleted file is to umount the appropriate device and perform fsck.ext2 (or whatever file system type you use) on the device. If that fails you have to reformat the device

Installation on a SL-5600 (by Ian Giblin)

I have installed your GCC on my SL-5600, but the setup is slightly different because the user is not root on the SL-5600, he/she is a user 'zaurus' and must su to root.

My steps to install (I chose to use Tools/gcc):

Put cramfs file in a folder /home/zaurus/Tools/gcc su to root (password is the user's power-on password)
mkdir /mnt/gcc
mount -t cramfs -o loop gcc.cramfs /mnt/gcc
Then, change your gcc-links script to the new path and execute it as super user, next
PATH=$PATH:/mnt/gcc/bin
export PATH
This now works fine. I have just compiled several programs.
the libstdc++ can be downloaded here, it may be needed by some programs.