[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

live-bottom script is not executed at startup & something strange with language.



Hi all.

I'm working on debian-live since few days, it's very powerfull! Thanks to the community.

First: my script problem:

I have realize a first simple script (attached at the end), maybe it's not the best but i have never write scripts and i'm new unix user :)

I write it,
I put it here (/live is my directory for debian lives works):

/live/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/20myscript.sh
with chmod 777

As the docs seem explain, I add this too:
/live/config/chroot_local-hooks/update-initramfs.sh
with chmod 777 too

I execute lh_clean (I test lh_clean --chroot too)
and lh_build with succès.

I start on Vbox with ISO file, all work fine but My script seem not considered. (Even if my script was bas, i must see the echo and read isn't it?)

Can every-one help me? I read and re-read the guide, but it seem insufficient! cf: http://wiki.debian.org/DebianLive/FAQ#Q.3AHowdoIaddascriptrunningimmediatelyafterallotherscriptswhenthelivesystemboots.3F




About the language problem:
I'm french (as you can read) and yesterday all was perfect (AZERTY etc. )
But today, nothing, i have create 3 iso with different parameters and nothing work, it seem to be a bug:

1) LH_BOOTAPPEND_LIVE="locale=fr_FR keyb=fr"

2) LH_BOOTAPPEND_LIVE="locale=fr"
    LH_BOOTAPPEND_INSTALL=" -- locale=fr keyb=fr"

3) LH_BOOTAPPEND_LIVE="locale=fr_FR.UTF-8"
    LH_BOOTAPPEND_INSTALL=" -- locale=fr_FR.UTF-8 keyb=fr

I don't know why, if i remember, I have put the first one yesterday :(


Thanks for your help!!


###### My (first?) script #######
#
#thanks to be indulgent with my scripting level :)
#
#!/bin/bash
echo "Check des uuid existants"
#Je met les uuid dans un fichier.
ls /dev/disk/by-uuid/ > /tmp/checkuuid
#Je crée la variable num qui contient le nombre de résultat dans le dossier by-uuid.
num=`ls /dev/disk/by-uuid/ | wc -l`
echo "$num uuid détectés"
mkdir /media/mymount
#Pour chaque ligne de checkuuid (et donc pour chaque uuid) faire...
for uuid in `cat /tmp/checkuuid`
do
   echo "uuid $uuid en cours de montage"
   # Montage de cet uuid, avec -n qui permet un montage en RO (sur /etc).
   mount -n -U $uuid /media/mymount
       # Si /media/mymount/test.tar.gz existe.
       if [ -a /media/mymount/test.tar.gz ] ; then
           echo "uuid $uuid contient test.tar.gz à sa racince"
#Je met le tar dans /tmp (cela évitera de décompresser sur la clé qui peut être lente et trop petite).
           cp /media/mymount/test.tar.gz /tmp
           tar -xzvf /tmp/test.tar.gz
           cp -a /tmp/test/ /home/
#Supression des éléments contenus dans le /tmp précédements créés. rm /tmp/test.tar.gz
           echo "Pressez une touchez pour continuer, opération effectuée!"
           read
exit 0 else
           echo "uuid $uuid ne contient pas etc.tar.gz à sa racine!"
# Décrémentation, afin de travailer sur l'uuid de la ligne précédente contenue dans checkuuid. num=`expr $num - 1`
           umount -v /media/mymount
       fi
done
echo "Fichier test.tar.gz non trouvé sur l'ensemble des disques"
echo "pressez une touche"
read
exit 1



Reply to: