2020-07-11 20:32:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-07-13 21:58:24 +02:00
|
|
|
# stick_build /dev/sdX
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-07-16 23:21:08 +02:00
|
|
|
ISO="live_svpro_gnu-amd64.hybrid.iso"
|
2020-07-13 21:58:24 +02:00
|
|
|
|
|
|
|
# Recuperation iso
|
|
|
|
echo "Téléchargement de l'iso..."
|
|
|
|
sleep 5
|
2020-07-16 23:21:08 +02:00
|
|
|
wget -O ${ISO} https://samuel.vermeulen.pro/telechargement/live_svpro_gnu-amd64.hybrid.iso
|
|
|
|
wget -O ${ISO}.md5 https://samuel.vermeulen.pro/telechargement/live_svpro_gnu-amd64.hybrid.iso.md5
|
2020-07-13 21:58:24 +02:00
|
|
|
echo "Vérification de l'image..."
|
|
|
|
|
|
|
|
if ! md5sum -c ${ISO}.md5
|
|
|
|
then
|
|
|
|
echo "ISO Corompue. Abandon !!"
|
|
|
|
rm -f ${ISO} ${ISO}.md5
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-07-11 20:32:05 +02:00
|
|
|
|
|
|
|
# Copie de l'image iso sur clé
|
2020-07-13 21:58:24 +02:00
|
|
|
echo "Transfert en cours..."
|
|
|
|
dd if=${ISO} of=$1 bs=4M status=progress
|
2020-07-11 20:32:05 +02:00
|
|
|
sync
|
|
|
|
|
|
|
|
# Création de la partition dédiée à la persistence
|
2020-07-13 21:58:24 +02:00
|
|
|
echo "Création de la persistence..."
|
|
|
|
sleep 5
|
|
|
|
printf 'n\np\n\n\n\nw' | fdisk $1
|
|
|
|
mkfs.ext4 -L persistence ${1}3
|
2020-07-11 20:32:05 +02:00
|
|
|
|
|
|
|
# Configuratio de la partition
|
2020-07-13 21:58:24 +02:00
|
|
|
mount ${1}3 /mnt
|
2020-07-11 20:32:05 +02:00
|
|
|
echo / union > /mnt/persistence.conf
|
|
|
|
umount /mnt
|
|
|
|
|
|
|
|
# Fin
|
|
|
|
echo "Terminé ! Vous pouvez booter sur la clé USB, la persistence sera auto-configurée lors du premier Boot !"
|
|
|
|
|
|
|
|
|
|
|
|
exit 0
|