31
Spain / Preguntas De Novato
« on: March 25, 2006, 07:05:01 am »
Mi version de rboot para 3.5.4. Mas info en InnerZaurus.com
Crear tu Imagen ext2 en SD. Donde pone OPIE puedes cambiarlo por GPE. Es mejor hacerlo a mano, paso por paso. Este script ejecutado en otro momento te borraria la imagen creada anteriormente y sin preguntar. No le pongas un #!/bin/sh delante y arreglado. Queda como DOC.
Parámetro /mnt/image/
DESPUES puedes reiniciar.
Si encuentras algún fallo. Comenta y corrijo para que quede "util"
Crear tu Imagen ext2 en SD. Donde pone OPIE puedes cambiarlo por GPE. Es mejor hacerlo a mano, paso por paso. Este script ejecutado en otro momento te borraria la imagen creada anteriormente y sin preguntar. No le pongas un #!/bin/sh delante y arreglado. Queda como DOC.
Code: [Select]
#Crear directorio boot-images
mkdir /mnt/card/boot-images
#
# el 63000 lo cambias por el tamaño que quieras. Son Bytes, casi 63 megas :)
dd of=/mnt/card/boot-images/opie-rootfs.img if=/dev/zero bs=1024 count=63000
#
#El paso anterior TARDA unos 3 segundos por MB. Ahora formatea la imagen
mkfs.ext2 /mnt/card/boot-images/opie-rootfs.img
#
# Crea directorio temporal para montar imagen
losetup /dev/loop1 /mnt/card/boot-images/opie-rootfs.bin
mkdir /mnt/image
mount -t ext2 /dev/loop1 /media/image
#
# *** Aqui deberia aparecer "lost+found" en /mnt/image/
#
ls -a /mnt/image
#
Copiando el sistema a la imagen.Parámetro /mnt/image/
Code: [Select]
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Usage: $0 "
exit
fi
NEWROOT=$1
# Lista de fichero para CREAR pero NO COPIAR
CREATELIST="/var /proc"
# you shouldn't need to modify below here
for FOLDER in /*
do
# these are the exceptions
if [ "$FOLDER" = "/dev" ]
then
# for /dev we need to move the ramdisk out of the way and copy the files in the actual folder
echo "Copying $FOLDER"
mkdir /dev.tmp
mount -o move /dev /dev.tmp
cp -a /dev /$NEWROOT/
mount -o move /dev.tmp /dev
rmdir /dev.tmp
elif [ "$FOLDER" = "/home" ]
then
# /home can be either linked or copied
if [ "$HOMELINK" = "yes" ]
then
echo "Linking $FOLDER"
ln -s /media/realroot/"$FOLDER" /$NEWROOT/"$FOLDER"
else
echo "Copying $FOLDER"
cp -a "$FOLDER" /$NEWROOT/
fi
elif [ "$FOLDER" = "/media" ]
then
# the media folder is a special case because we want to create the folder and
# its immediate subfolders, but not more than that
echo "Creating $FOLDER"
mkdir /$NEWROOT/"$FOLDER"
for MFOLDER in "$FOLDER"/*
do
echo "Creating $MFOLDER"
mkdir /$NEWROOT/"$MFOLDER"
done
elif [ "$FOLDER" = "/mnt" ]
then
# we create the /mnt folder, test for links, copy them, and then create folders
echo "Creating $FOLDER"
mkdir /$NEWROOT/"$FOLDER"
for MFOLDER in "$FOLDER"/*
do
# copy the links
if [ -L "$MFOLDER" ]
then
echo "Copying $MFOLDER"
cp -a "$MFOLDER" /"$NEWROOT"/"$FOLDER"
else
echo "Creating $MFOLDER"
mkdir /$NEWROOT/"$MFOLDER"
fi
done
else
# check to see if this folder is in our create list
for CFOLDER in $CREATELIST
do
if [ "$CFOLDER" = "$FOLDER" ]
then
echo "Creating $FOLDER"
mkdir /$NEWROOT/"$FOLDER"
fi
done
# if it has not been created (i.e. it is not
# in the create list) than copy it
if [ ! -e "/$NEWROOT/$FOLDER" ]
then
echo "Copying $FOLDER"
cp -a "$FOLDER" /$NEWROOT/
fi
fi
done
if [ -f /$NEWROOT/sbin/init.org ]
then
echo "Cleaning up"
mv /$NEWROOT/sbin/init.org /$NEWROOT/sbin/init
rm /$NEWROOT/etc/rboot.conf
fi
#===========
#===========
DESMONTA /mnt/image y /mnt/cardDESPUES puedes reiniciar.
Si encuentras algún fallo. Comenta y corrijo para que quede "util"