ajout de la synchronisation des bootloader EFI
Signed-off-by: Daniel Tartavel <dtux@free.fr>
This commit is contained in:
parent
d8223ad28f
commit
36c501b754
89
mirror_mageia_hd
Executable file → Normal file
89
mirror_mageia_hd
Executable file → Normal file
@ -1,86 +1,65 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#mirror_mageia_hd
|
#mirror_mageia_hd
|
||||||
version="6"
|
|
||||||
|
version_list="8" # liste les versions de Mageia à synchroniser.
|
||||||
dossier=""
|
dossier=""
|
||||||
boot=""
|
boot=""
|
||||||
param=" --delete-excluded --exclude SRPMS/ --exclude *_testing/ --exclude */debug/ --exclude aarch64/ --exclude armv5tl/ --exclude armv7hl/ "
|
param="--ignore-existing --exclude SRPMS/ --exclude armv5tl/ --exclude armv7hl/ --exclude aarch64/ --exclude *_testing/ --exclude */debug/"
|
||||||
param_iso=""
|
|
||||||
|
|
||||||
for DIRECTORY in /run/media/$USER/*
|
for DIRECTORY in /run/media/$USER/*
|
||||||
do
|
do
|
||||||
echo "$DIRECTORY"
|
|
||||||
if [ -d "$DIRECTORY" ]; then
|
if [ -d "$DIRECTORY" ]; then
|
||||||
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
||||||
echo "$DIRECTORY/mageia/distrib trouvé"
|
echo "$DIRECTORY/mageia/distrib trouvé"
|
||||||
dossier=$DIRECTORY/mageia/distrib
|
dossier="$DIRECTORY/mageia/distrib"
|
||||||
elif [ -e "$DIRECTORY/extlinux" ]; then
|
elif [ -e "$DIRECTORY/extlinux/extlinux.conf" ]; then
|
||||||
echo "$DIRECTORY/extlinux trouvé"
|
echo "$DIRECTORY/extlinux/extlinux.conf trouvé"
|
||||||
boot="$DIRECTORY"
|
boot="$DIRECTORY/"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -z $dossier ] || [ -z $boot ]; then
|
if [ -z "$dossier" ] || [ -z "$boot" ]; then
|
||||||
for DIRECTORY in /mnt/tmp*
|
for DIRECTORY in /mnt/*
|
||||||
do
|
do
|
||||||
if [ -d "$DIRECTORY" ]; then
|
if [ -d "$DIRECTORY" ]; then
|
||||||
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
if [ -e "$DIRECTORY/mageia/distrib" ]; then
|
||||||
echo "$DIRECTORY/mageia/distrib trouvé"
|
echo "$DIRECTORY/mageia/distrib trouvé"
|
||||||
dossier=$DIRECTORY/mageia/distrib
|
dossier=$DIRECTORY/mageia/distrib
|
||||||
elif [ -e "$DIRECTORY/grub/menu.lst" ]; then
|
elif [ -e "$DIRECTORY/extlinux/extlinux.conf" ]; then
|
||||||
echo "$DIRECTORY/grub/menu.lst trouvé"
|
echo "$DIRECTORY/extlinux/extlinux.conf trouvé"
|
||||||
boot="$DIRECTORY"
|
boot="$DIRECTORY/"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
echo "dossier => $dossier"
|
||||||
if [ -z $dossier ] || [ -z $boot ]; then
|
echo "boot => $boot"
|
||||||
echo "Erreur dossiers non trouvés"
|
|
||||||
echo "BOOT=$boot"
|
|
||||||
echo "Dossier=$dossier"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "/mirror/mageia/distrib/$version" ];then
|
if [ -d "/mirror/mageia/distrib/$version" ];then
|
||||||
serveur='/mirror'
|
serveur='/mirror'
|
||||||
else
|
else
|
||||||
serveur="rsync://fr2.rpmfind.net/linux"
|
serveur="rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n $dossier ] && [ -n $boot ];then
|
if [ -n "$dossier" ] && [ -n "$boot" ];then
|
||||||
|
for version in $version_list; do
|
||||||
|
echo "rsync -avP $param $serveur/distrib/$version/ $dossier/$version/"
|
||||||
|
rsync -P -aHS --delete-after --delay-updates $param "$serveur/distrib/$version/" "$dossier/$version/"
|
||||||
|
|
||||||
# synchronisation du miroir
|
# Copie des fichiers de boot CSM
|
||||||
echo "rsync -avP $param $serveur/mageia/distrib/$version/ $dossier/$version/"
|
cd "$dossier/$version"
|
||||||
rsync -aP $param $serveur/mageia/distrib/$version $dossier/
|
rsync -aP i586/isolinux/i386/vmlinuz "$boot/vmlinuz_$version_i586"
|
||||||
|
rsync -aP x86_64/isolinux/x86_64/vmlinuz "$boot/isolinux/x86_64/vmlinuz_$version"
|
||||||
# synchronisation des iso
|
rsync -aP i586/isolinux/i386/all.rdz "$boot/all_$version_i586.rdz"
|
||||||
rsync -aP --exclude "*GNOME*" --exclude "*rescue*" $serveur/mageia/iso/"$version".1 `dirname $dossier`/iso/
|
rsync -aP x86_64/isolinux/x86_64/all.rdz "$boot/isolinux/x86_64/all_$version.rdz"
|
||||||
if [ -d $serveur/mageia.iso/"$vesion".1 ]; then
|
# Copie des fichers de boot EFI
|
||||||
param_iso=" --delete-excluded --exclude '*Live*' "
|
tmp_dir=$(mktemp -d -t mirror_mageia_hd-XXXXXXXXXX)
|
||||||
fi
|
pushd $tmp_dir
|
||||||
rsync -aP $param_iso --exclude "*GNOME*" --exclude "*rescue*" $serveur/mageia/iso/$version `dirname $dossier`/iso/
|
rpm2cpio x86_64/media/core/release/drakiso-bootloader-files-1.17-1.mga8.x86_64.rpm | cpio --extract --make-directories
|
||||||
|
rsync -aP $tmpdir/usr/share/drakiso/bootloader/images/bootx64.efi
|
||||||
# copie du kernel et de initrd dans partition de boot
|
rpm2cpio i586/media/core/release/drakiso-bootloader-files-1.17-1.mga8.i586.rpm | cpio --extract --make-directories
|
||||||
cd $dossier/$version
|
rsync -aP $tmpdir/usr/share/drakiso/bootloader/images/bootia32.efi
|
||||||
echo "rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_"$version"_i586"
|
done
|
||||||
rsync -aP i586/isolinux/i386/vmlinuz "$boot"/vmlinuz_"$version"_i586
|
|
||||||
echo "rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_"$version"_x86_64"
|
|
||||||
rsync -aP x86_64/isolinux/x86_64/vmlinuz "$boot"/vmlinuz_"$version"_x86_64
|
|
||||||
rsync -aP i586/isolinux/i386/all.rdz "$boot"/all_"$version"_i586.rdz
|
|
||||||
rsync -aP x86_64/isolinux/x86_64/all.rdz "$boot"/all_"$version"_x86_64.rdz
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ -d "/mirror/mageia/distrib/cauldron" ];then
|
|
||||||
serveur='/mirror'
|
|
||||||
else
|
else
|
||||||
serveur="rsync://fr2.rpmfind.net/linux"
|
echo "il manque un dossier (boot ou miroir) voir plus haut"
|
||||||
fi
|
|
||||||
rsync -aP $param $serveur/mageia/distrib/cauldron/i586 $dossier/cauldron/
|
|
||||||
|
|
||||||
cd $dossier/cauldron
|
|
||||||
rsync -aP i586/isolinux/i386/vmlinuz $boot/vmlinuz_cauldron_i586
|
|
||||||
# rsync -aP x86_64/isolinux/x86_64/vmlinuz $boot/vmlinuz_cauldron_x86_64
|
|
||||||
rsync -aP i586/isolinux/i386/all.rdz $boot/all_cauldron_i586.rdz
|
|
||||||
# rsync -aP x86_64/isolinux/x86_64/all.rdz $boot/all_cauldron_x86_64.rdz
|
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user