2020-08-06 00:23:47 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Creation de la clef ./build_svprognu -d /dev/sdX
|
|
|
|
# Creation de l'iso seule ./build_svprognu
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-10-14 16:17:55 +02:00
|
|
|
ISO="live_svpro_gnu-amd64.hybrid.iso"
|
2020-10-14 14:20:31 +02:00
|
|
|
|
|
|
|
# Recuperation iso
|
|
|
|
echo "Téléchargement de l'iso..."
|
|
|
|
sleep 5
|
|
|
|
wget -O ${ISO} https://www.weblib.re/dokuwiki/_media/svpro_gnu:live_svpro_gnu-amd64.hybrid.iso
|
|
|
|
wget -O ${ISO}.md5sum https://www.weblib.re/dokuwiki/_media/svpro_gnu:live_svpro_gnu-amd64.hybrid.iso.md5sum
|
|
|
|
echo "Vérification de l'image..."
|
|
|
|
|
|
|
|
if ! md5sum -c ${ISO}.md5sum
|
|
|
|
then
|
|
|
|
echo "ISO Corompue. Abandon !!"
|
|
|
|
rm -f ${ISO} ${ISO}.md5
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-08-06 00:23:47 +02:00
|
|
|
# Copie de l'image iso sur clé
|
2020-08-06 16:45:01 +02:00
|
|
|
while getopts ":d: " opt; do
|
2020-08-06 00:23:47 +02:00
|
|
|
case $opt in
|
|
|
|
d)
|
|
|
|
echo "Transfert en cours..."
|
|
|
|
dd if=${ISO} of=$OPTARG bs=4M status=progress
|
|
|
|
sync
|
|
|
|
|
|
|
|
# Création de la partition dédiée à la persistence
|
|
|
|
echo "Création de la persistence..."
|
|
|
|
sleep 5
|
|
|
|
printf 'n\np\n\n\n\nw' | fdisk $OPTARG
|
|
|
|
mkfs.ext4 -L persistence ${OPTARG}3
|
|
|
|
|
|
|
|
# Configuratio de la partition
|
|
|
|
mkdir -p ./tmp
|
|
|
|
mount ${OPTARG}3 ./tmp
|
|
|
|
echo "/ union" > ./tmp/persistence.conf
|
|
|
|
umount ./tmp
|
|
|
|
|
|
|
|
# Fin
|
|
|
|
echo "Terminé ! Vous pouvez booter sur la clé USB, la persistence sera auto-configurée lors du premier Boot !"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|