Commit bdfef820 authored by fenwe's avatar fenwe
Browse files

debianNetboot

parent 654e8427
......@@ -498,4 +498,117 @@ install_virtualBox(){
}
fonctionsTbl['install_virtualBox']=install_virtualBox;
# Telecharge la derniere version netinstall en netboot amd64
# la copie sshfs est specifique a mon systeme il est facilement adaptable.
debianNetboot(){
#appendSysmenu( $1=noyauPath $2=initrdPath)
appendSysmenu(){
menuPath="$destination/sysMenu/menus/subMenu-linuxInstall-auto.cfg";
echo "" >> $menuPath;
echo "LABEL $2" >> $menuPath;
echo " KERNEL images/linux/kernel/debian-installer/$1" >> $menuPath;
echo " INITRD images/linux/kernel/debian-installer/$2" >> $menuPath;
echo " APPEND priority=low vga=788 --" >> $menuPath;
}
echo $BOLD${INFO}Telechargement de la derniere version de Debian Netboot$NORMAL$NOBOLD
declare -A debian;
debianStable=10;
debianUnstable=$(($debianStable + 1));
#debianSid=$(($debianStable + 2));
debian[10]="buster";
debian[11]="bullseye";
debian["sid"]="sid";
#echo ${debian[$debianStable]}
declare -r FTP_DIST="http://ftp.fr.debian.org/debian/dists";
declare -r FTP_DIST_STABLE="$FTP_DIST/${debian[$debianStable]}/main/installer-amd64/current/images/netboot"
declare -r FTP_DIST_UNSTABLE="$FTP_DIST/${debian[$debianUnstable]}/main/installer-amd64/current/images/netboot"
declare -r FTP_DIST_SID="$FTP_DIST/sid/main/installer-amd64/current/images/netboot"
echo "${INFO}Liste des FTP$NORMAL"
echo $FTP_DIST_STABLE/
echo $FTP_DIST_UNSTABLE/
echo $FTP_DIST_SID/
echo "${INFO}stable current AMD64 noyau$NORMAL"
evalCmd "mkdir -p /tmp/debian/"
cd /tmp/debian/
# copier le kernel
fichier="linux";
if [ -f $fichier ]; then rm $fichier; fi
wget $FTP_DIST_STABLE/debian-installer/amd64/$fichier
d=$(date -r $fichier '+%Y.%m.%d')
cible="$d-debian-$debianStable-netboot-amd64-linux";
evalCmd "cp $fichier $cible"
linux=$cible;
fichier="initrd.gz";
if [ -f $fichier ]; then rm $fichier; fi
wget $FTP_DIST_STABLE/debian-installer/amd64/$fichier
d=$(date -r $fichier '+%Y.%m.%d')
cible="$d-debian-$debianStable-netboot-amd64-txt-initrd.gz";
evalCmd "cp $fichier $cible"
initrdTxt=$cible;
echo "${INFO}stable current AMD64 gtk$NORMAL"
fichier="initrd.gz";
if [ -f $fichier ]; then rm $fichier; fi
wget $FTP_DIST_STABLE/gtk/debian-installer/amd64/$fichier
d=$(date -r $fichier '+%Y.%m.%d')
cible="$d-debian-$debianStable-netboot-amd64-gtk-initrd.gz";
evalCmd "cp $fichier $cible"
initrdGTK=$cible;
echo "${INFO}transfert des fichiers$NORMAL"
# monter le repertoire distant
destination="/legralNet/legral-serveur/legral-serveur-tftp";
evalCmd "sshfs pi@192.168.0.202:/srv/tftp/ $destination -o follow_symlinks;"
#tester s'il est bien monté
if [ -f "$destination/pxelinux.0" ];
then
kernelRoot="$destination/images/linux/kernel/debian-installer"
if [ ! -f "$kernelRoot/$linux" ];
then
evalCmd "cp $linux $kernelRoot/$linux";
else
echo "${INFO}$kernelRoot/$linux existe deja$NORMAL"
fi
if [ ! -f "$kernelRoot/$initrdTxt" ];
then
evalCmd "cp $initrdTxt $kernelRoot/$initrdTxt";
appendSysmenu $linux $initrdTxt
else
echo "${INFO}$kernelRoot/$initrdTxt existe deja$NORMAL"
fi
appendSysmenu $linux $initrdTxt
if [ ! -f "$kernelRoot/$initrdGTK" ];
then
evalCmd "cp $initrdGTK $kernelRoot/$initrdGTK";
appendSysmenu $linux $initrdGTK
else
echo "${INFO}$kernelRoot/$initrdGTK existe deja$NORMAL"
fi
appendSysmenu $linux $initrdGTK
# demonter le repertoire distant
evalCmd "fusermount -u $destination"
else
echo "${WARN}Le repertoire n'est pas monté.$NORMAL"
fi
}
fonctionsTbl['debianNetboot']=debianNetboot;
echo "Fin de legite-install.etc.sh"
......@@ -8,5 +8,6 @@
* desactivation de isConf qui etait mal utilisé
* chargement systematique de CONF_USER_PATH si existant
* affichage trié lors de --showLibs
* debianNetboot
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment